/* =============================================
   アイカーパス フロント共通CSS
   ============================================= */

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', Meiryo, sans-serif; color: #333; background: #f5f7fa; line-height: 1.7; min-height: 100vh; display: flex; flex-direction: column; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
table { border-collapse: collapse; width: 100%; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header { background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 60px; }
.logo { font-size: 18px; font-weight: bold; color: #1e40af; }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 20px; }
.nav a { color: #555; font-size: 14px; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { color: #1e40af; border-bottom-color: #1e40af; text-decoration: none; }
.badge { background: #ef4444; color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-left: 4px; }

.user-menu { position: relative; }
.user-name { font-size: 14px; cursor: pointer; padding: 6px 12px; border-radius: 4px; }
.user-name:hover { background: #f3f4f6; }
.dropdown { display: none; position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); min-width: 160px; z-index: 200; }
.user-menu:hover .dropdown { display: block; }
.dropdown a { display: block; padding: 8px 16px; color: #333; font-size: 14px; }
.dropdown a:hover { background: #f3f4f6; text-decoration: none; }

/* Main */
.main { flex: 1; padding: 30px 0; }

/* Footer */
.footer { background: #fff; border-top: 1px solid #e5e7eb; padding: 16px 0; text-align: center; font-size: 13px; color: #999; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Cards */
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); padding: 24px; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-header h2 { font-size: 16px; color: #1e293b; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }

/* Vehicle Card */
.vehicle-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; transition: box-shadow 0.2s; }
.vehicle-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.vehicle-card a { color: inherit; }
.vehicle-card a:hover { text-decoration: none; }
.vehicle-photo { width: 100%; height: 180px; object-fit: cover; background: #f3f4f6; }
.vehicle-info { padding: 16px; }
.vehicle-info h3 { font-size: 15px; margin-bottom: 8px; }
.vehicle-meta { font-size: 13px; color: #666; }
.vehicle-meta span { display: inline-block; margin-right: 12px; }

/* Status badges */
.status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-active { background: #dcfce7; color: #166534; }
.status-expired { background: #fef2f2; color: #b91c1c; }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-accepted { background: #dbeafe; color: #1e40af; }
.status-in_progress { background: #e0e7ff; color: #3730a3; }
.status-completed { background: #dcfce7; color: #166534; }
.status-rejected { background: #fef2f2; color: #b91c1c; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-checked_in { background: #e0e7ff; color: #3730a3; }
.status-cancelled { background: #f3f4f6; color: #6b7280; }

/* Summary cards (dashboard) */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.summary-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); padding: 20px; text-align: center; }
.summary-card .label { font-size: 13px; color: #64748b; margin-bottom: 4px; }
.summary-card .value { font-size: 28px; font-weight: bold; color: #1e293b; }
.summary-card .sub { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.summary-card.warning .value { color: #dc2626; }
.summary-card.ok .value { color: #16a34a; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.form-group .hint { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="url"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-group textarea { min-height: 120px; resize: vertical; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-errors { background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; }
.form-errors ul { margin: 0; padding-left: 20px; }
.form-errors li { color: #b91c1c; font-size: 14px; }

/* Buttons */
.btn { display: inline-block; padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; transition: background 0.2s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: #fff; color: #2563eb; border: 1px solid #2563eb; }
.btn-outline:hover { background: #eff6ff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }

.actions { display: flex; gap: 10px; align-items: center; }
.actions-right { justify-content: flex-end; }
.actions-between { justify-content: space-between; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; font-size: 14px; }
table.data-table th { background: #f8fafc; padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
table.data-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
table.data-table tr:hover td { background: #fafbfc; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.pagination a, .pagination span { display: inline-block; padding: 6px 12px; border: 1px solid #e5e7eb; border-radius: 4px; font-size: 14px; color: #333; }
.pagination a:hover { background: #f3f4f6; text-decoration: none; }
.pagination .current { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Detail page */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item { padding: 8px 0; }
.detail-item .label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-item .value { font-size: 15px; color: #1e293b; margin-top: 2px; }

/* Photo gallery */
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 16px; }
.photo-gallery img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; cursor: pointer; }

/* Login page */
.login-wrap { max-width: 400px; margin: 60px auto; }
.login-wrap .card { padding: 32px; }
.login-wrap h1 { text-align: center; font-size: 22px; color: #1e293b; margin-bottom: 24px; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: #94a3b8; }
.empty-state p { font-size: 15px; margin-bottom: 16px; }

/* Responsive */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; }
    .nav { width: 100%; overflow-x: auto; gap: 12px; padding: 8px 0; }
    .form-row { flex-direction: column; gap: 0; }
    .detail-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    table.data-table { font-size: 13px; }
}
