/* VehiLink Admin Panel Stylesheet (Enterprise Web UI) */

body.admin-body {
    background-color: #f1f5f9;
    color: #1e293b;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.admin-sidebar {
    width: 270px;
    background-color: #1e293b;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
    border-right: 1px solid #334155;
}

.admin-sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-brand {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-brand span {
    color: #3b82f6;
}

.admin-sidebar-menu {
    list-style: none;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
}

.admin-menu-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    padding: 16px 12px 8px 12px;
    letter-spacing: 0.5px;
}

.admin-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.admin-menu-link:hover, .admin-menu-link.active {
    background-color: #334155;
    color: #ffffff;
}

.admin-menu-link.active {
    border-left: 3px solid #3b82f6;
    background-color: #0f172a;
}

/* Main Content Panel */
.admin-main {
    flex: 1;
    margin-left: 270px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-navbar-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.admin-navbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-profile-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #3b82f6;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.admin-content-body {
    padding: 32px;
    flex: 1;
}

/* Dashboard Metric Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.admin-stat-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.admin-stat-label {
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 6px;
}

.admin-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
}

/* Data Tables */
.admin-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 32px;
    overflow: hidden;
}

.admin-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.admin-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.admin-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    padding: 14px 24px;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 12px;
}

.admin-table td {
    padding: 14px 24px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
}

.badge-success { background-color: #d1fae5; color: #065f46; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-info { background-color: #e0f2fe; color: #075985; }

/* Registry Management Tabs */
.admin-registry-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.admin-registry-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
    min-width: 160px;
}

.admin-registry-tab:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.admin-registry-tab.active {
    background-color: #0f172a;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.admin-registry-tab-badge {
    background-color: #ff0055;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.2;
}

.admin-registry-tab.active .admin-registry-tab-badge {
    background-color: #ffffff;
    color: #ff0055;
}

/* Users with nested vehicles */
.admin-user-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-user-block {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background-color: #ffffff;
}

.admin-user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.admin-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #cbd5e1;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.admin-user-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.admin-user-id {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-left: 4px;
}

.admin-user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.admin-user-meta i {
    margin-right: 4px;
    color: #94a3b8;
}

.admin-user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-user-vehicles {
    padding: 0;
}

.admin-nested-table th {
    background-color: #ffffff;
    font-size: 11px;
    padding: 10px 20px;
}

.admin-nested-table td {
    padding: 12px 20px;
    font-size: 13px;
}

.admin-user-no-vehicles {
    padding: 16px 20px;
    font-size: 13px;
    color: #94a3b8;
    background-color: #fafbfc;
}

.admin-user-no-vehicles i {
    margin-right: 6px;
}

/* QR Management */
.admin-qr-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.admin-qr-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.admin-qr-table-card {
    margin-bottom: 0;
}

.admin-qr-serial {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    font-size: 13px;
    color: #0f172a;
    letter-spacing: 0.3px;
}

.admin-qr-serial-lg {
    font-size: 18px;
}

.admin-qr-code-preview,
.admin-plate-badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #0f172a;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    background-color: #fef08a;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.admin-qr-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.15s ease;
}

.admin-qr-copy-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.admin-qr-copy-url {
    margin-left: 0;
}

.admin-qr-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 88px;
}

.admin-qr-generator {
    padding: 24px;
    text-align: center;
    margin-bottom: 0;
}

.admin-qr-generator-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f172a, #334155);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.admin-qr-generator-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}

.admin-qr-generator-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 18px;
}

.admin-qr-format-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
}

.admin-qr-format-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.admin-qr-format-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 20px;
    font-weight: 800;
    color: #6366f1;
    letter-spacing: 0.5px;
}

.admin-qr-new-code {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
    text-align: left;
}

.admin-qr-new-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.admin-qr-scan-url {
    display: block;
    font-size: 10px;
    color: #047857;
    word-break: break-all;
    line-height: 1.4;
}

.admin-qr-generate-btn {
    width: 100%;
    padding: 12px 16px;
    font-weight: 700;
}

.admin-qr-help {
    padding: 18px 20px;
    background: #eff6ff;
    border-color: #bfdbfe;
    margin-bottom: 0;
}

.admin-qr-help h4 {
    color: #1e40af;
    font-size: 14px;
    margin-bottom: 10px;
}

.admin-qr-help ul {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: #1e3a8a;
    line-height: 1.6;
}

.admin-qr-help code {
    background: #ffffff;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
}

@media (max-width: 1100px) {
    .admin-qr-layout {
        grid-template-columns: 1fr;
    }

    .admin-qr-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .admin-qr-stats {
        grid-template-columns: 1fr;
    }
}

/* Collapsible behavior for smaller viewports */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    .admin-navbar {
        padding: 16px;
    }
    .admin-content-body {
        padding: 16px;
    }
}
