/* Admin Panel & Shell Styles */
.admin-summary { padding: 24px var(--gutter, 24px); }
.admin-client-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.admin-client-filter select { flex: 1; min-width: 0; max-width: 650px; }
.admin-financials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; border-block: 1px solid #dbe3e5; padding: 20px 0; }
.admin-financials h3 { font-size: 16px; margin: 0 0 6px; }
.admin-financials p { font-size: 22px; font-weight: bold; margin: 0; }
.admin-financials small { font-size: 14px; color: #64748b; }

#camera-preview { width: min(960px, calc(100vw - 32px)); max-width: 960px; padding: 16px; border: 1px solid #ccd6da; border-radius: 8px; background: white; max-height: 90dvh; overflow: auto; }
#camera-preview::backdrop { background: rgb(0 0 0 / 70%); }
.camera-preview-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.camera-preview-heading h2 { font-size: 20px; margin: 0; overflow-wrap: anywhere; }
.camera-preview-heading button { width: 40px; height: 40px; flex-shrink: 0; padding: 0; font-size: 26px; }
.camera-preview-frame { aspect-ratio: 16/9; background: #000; }
.camera-preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Admin Shell Layout */
.admin-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    color: #1e293b;
    font-family: inherit;
}

/* Admin Topbar */
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    padding: 0 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-mobile-toggle {
    display: none;
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 18px;
    cursor: pointer;
    color: #334155;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.admin-brand img {
    height: 28px;
    width: auto;
    display: block;
}

.admin-badge-console {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    background: #e0f2fe;
    color: #0369a1;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #bae6fd;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-view-site {
    font-size: 13px;
    font-weight: 600;
    color: #275d69;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    transition: background 0.15s ease;
}

.admin-view-site:hover {
    background: #dcfce7;
}

.admin-lang-form {
    display: flex;
    align-items: center;
    margin: 0;
    gap: 6px;
}

.admin-lang-select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
}

.admin-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 500;
}

.admin-avatar {
    font-size: 14px;
}

.admin-btn-logout {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.admin-btn-logout:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Admin Body & Sidebar */
.admin-body-wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 64px);
}

.admin-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #0f1f26;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid #1e3a47;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    z-index: 90;
}

.admin-nav-group {
    padding: 16px 12px 6px;
}

.admin-nav-group-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-left: 10px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 6px;
    margin-bottom: 3px;
    transition: all 0.15s ease;
}

.admin-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.admin-nav-item.active {
    background: #00a6a6;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 166, 166, 0.35);
}

.admin-nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.admin-badge-count {
    background: #f43f5e;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: auto;
}

.admin-sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #94a3b8;
    overflow: hidden;
}

.admin-sidebar-user strong {
    color: #ffffff;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Content Pane & Main */
.admin-content-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.admin-main {
    flex: 1;
    padding: 0;
    min-width: 0;
}

/* Uniform Admin Card */
.admin-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin: 24px;
}

.admin-card h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.25rem;
    color: #0f172a;
}

.admin-card form {
    display: grid;
    gap: 16px;
}

/* Uniform Backend Footer */
.admin-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #64748b;
    margin-top: auto;
}

.admin-footer strong {
    color: #1e293b;
}

.admin-sys-pill {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #334155;
}

.sys-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.admin-footer-links {
    display: flex;
    gap: 16px;
}

.admin-footer-links a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.admin-footer-links a:hover {
    color: #00a6a6;
}

/* Mobile Responsive Drawer */
@media (max-width: 991px) {
    .admin-mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.25);
        transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .admin-sidebar.open {
        left: 0;
    }
    .admin-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    .admin-sidebar-overlay.active {
        display: block;
    }
    .admin-user-chip {
        display: none;
    }
    .admin-card {
        margin: 16px;
        padding: 16px;
    }
}

@media (min-width: 992px) {
    .admin-mobile-toggle {
        display: none;
    }
    .admin-sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .admin-financials { grid-template-columns: 1fr; gap: 8px; }
    .admin-client-filter label { width: 100%; }
    .admin-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
}
