/* SQUADRA SHELF AUDIT - DESIGN SYSTEM & DARK MODE GLOBAL STYLES */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #0F172A;
    --bg-card: #1E293B;
    --bg-sidebar: #0B0F19;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --primary: #FF007F;
    --primary-hover: #E60072;
    --success: #22C55E;
    --danger: #EF4444;
    --warning: #F59E0B;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --glow-primary: 0 0 15px rgba(255, 0, 127, 0.45);
    --glow-success: 0 0 15px rgba(34, 197, 94, 0.3);
    --sidebar-w: 270px;   /* largura da sidebar; a appbar e o conteúdo derivam daqui */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2e3c54;
}

/* Authentication Page */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(34, 197, 94, 0.05) 0%, transparent 40%);
}

.auth-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-logo span {
    color: var(--primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Form inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--glow-primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    color: white !important;
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.25);
    color: #FCA5A5;
}

/* Sidebar Layout */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #090d16 0%, #05080e 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;                       /* começa abaixo da appbar */
    height: calc(100vh - 56px);
    z-index: 100;
    padding: 1rem 1rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 0.5rem 1rem 1.5rem 1rem;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.sidebar-brand span {
    background: linear-gradient(135deg, var(--primary) 0%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex-grow: 1;
    overflow-y: auto;
}

.menu-item {
    position: relative;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 0.85rem;                 /* folga ícone → texto */
    padding: 0.28rem 0.7rem;      /* ~4.5px vertical: itens bem juntos */
    color: var(--text-secondary);
    font-weight: 300;             /* mais fina (Inter 300 já é carregada) */
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.8rem;            /* ~12.8px, menor */
    line-height: 1.4;
}

/* Ícone do item: grade fixa para tudo alinhar em coluna. */
.menu-item-icon {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    color: #8b98ad;
    transition: color 0.2s ease;
}
.menu-item-label { min-width: 0; }

.menu-item a:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.04);
}
.menu-item a:hover .menu-item-icon { color: #cfd8e3; }

.menu-item.active a {
    background-color: rgba(255, 0, 127, 0.07);
    color: var(--primary);
    font-weight: 500;
}
.menu-item.active a .menu-item-icon { color: var(--primary); }

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: linear-gradient(180deg, var(--primary) 0%, #d946ef 100%);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.8);
}

.menu-item.active a:hover {
    background-color: rgba(255, 0, 127, 0.1);
    color: var(--primary);
}

/* Collapsible menu group (e.g. "Super Admin"), built on <details>/<summary>. */
.menu-group-item {
    padding: 0;
}

/* Section divider between collapsible groups. */
.menu-group-item + .menu-group-item {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.75rem;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-radius: 6px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide the default disclosure triangle across browsers. */
.menu-group > summary::-webkit-details-marker { display: none; }
.menu-group > summary::marker { content: ''; }

.menu-group > summary:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.03);
}

.menu-group-caret {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.menu-group[open] > summary .menu-group-caret {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    margin: 0.1rem 0 0 0;
    padding: 0 0 0 0.35rem;   /* leve recuo para indicar aninhamento */
    display: flex;
    flex-direction: column;
    gap: 0;                   /* itens colados; o respiro vem só do padding */
}

.sidebar-footer {
    padding: 1rem 0 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.user-info {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 0 1rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-w);
    flex-grow: 1;
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== App bar (faixa superior, estilo Google Cloud) ===== */
.layout-wrapper { padding-top: 56px; }   /* espaço para a appbar fixa */

.appbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    z-index: 200;                        /* acima da sidebar */
    display: flex;
    align-items: center;
    gap: 0;                              /* alinhamento exato: espaçamento vem das margens */
    padding: 0 0.9rem 0 0;               /* sem padding à esquerda: quem posiciona é o .appbar-lead */
    background: #0b0f17;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/* Zona da marca = largura da sidebar, então a busca começa onde o menu termina. */
.appbar-lead {
    width: var(--sidebar-w);
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.06);  /* continua a linha da sidebar */
}
.appbar-ham {
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.15rem; padding: 0.4rem; border-radius: 8px;
    display: flex; align-items: center;
}
.appbar-ham:hover { background: rgba(255,255,255,0.06); color: #fff; }
.appbar-brand {
    font-family: var(--font-heading);
    font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em;
    color: var(--text-primary); white-space: nowrap;
}
.appbar-brand span {
    background: linear-gradient(135deg, var(--primary) 0%, #d946ef 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.tenant-pill {
    display: flex; align-items: center; gap: 0.5rem;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px; padding: 0.3rem 0.5rem 0.3rem 0.85rem;
}
.tenant-pill-mark { color: var(--primary); font-size: 0.6rem; }
.tenant-pill select {
    background: transparent; border: none; outline: none;
    color: var(--text-primary); font-size: 0.8rem; cursor: pointer;
    max-width: 180px; font-family: var(--font-sans);
}
.tenant-pill select option { background: var(--bg-card); color: var(--text-primary); }
/* Wrap: posiciona o dropdown e carrega o flex/alinhamento. */
.appbar-search-wrap {
    margin-left: 0;                      /* borda esquerda em x=270, alinhada ao fim do menu */
    margin-right: 0.9rem;                /* respiro até o próximo item */
    flex: 1; max-width: 520px;
    position: relative;
}
.appbar-search {
    width: 100%;
    display: flex; align-items: center; gap: 0.6rem;
    background: #161d29; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; padding: 0.4rem 0.9rem;
    color: var(--text-secondary); font-size: 0.82rem;
}
.appbar-search:focus-within { border-color: rgba(255,0,127,0.5); }
.appbar-search-input {
    flex: 1; min-width: 0;
    background: transparent; border: none; outline: none;
    color: var(--text-primary); font-size: 0.82rem;
    font-family: var(--font-sans);
    padding: 0.15rem 0;
}
.appbar-search-input::placeholder { color: var(--text-secondary); }
.appbar-search-clear { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.85rem; padding: 0 0.15rem; }
.appbar-search-clear:hover { color: #fff; }

/* Dropdown de resultados */
.appbar-search-pop {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 12px 28px -6px rgba(0,0,0,0.55);
    max-height: 70vh; overflow-y: auto; z-index: 210; padding: 0.4rem;
}
.appbar-search-pop.open { display: block; }
.ss-group-title {
    font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-secondary); font-weight: 700;
    padding: 0.6rem 0.7rem 0.3rem;
}
.ss-item {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.5rem 0.7rem; border-radius: 8px;
    color: var(--text-primary); text-decoration: none; cursor: pointer;
}
.ss-item:hover, .ss-item.active { background: rgba(255,255,255,0.06); }
.ss-item i { width: 18px; text-align: center; color: #8b98ad; font-size: 0.9rem; flex-shrink: 0; }
.ss-item .ss-txt { min-width: 0; }
.ss-item .ss-label { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-item .ss-sub { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-empty, .ss-loading { padding: 1rem 0.8rem; text-align: center; font-size: 0.8rem; color: var(--text-secondary); }
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.appbar-ic {
    position: relative; width: 38px; height: 38px; border-radius: 50%;
    background: none; border: none; cursor: pointer;
    color: #b6c1cf; font-size: 1.05rem;
    display: flex; align-items: center; justify-content: center;
}
.appbar-ic:hover { background: rgba(255,255,255,0.06); }
.appbar-badge {
    position: absolute; top: 5px; right: 6px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: var(--primary); color: #fff;
    font-size: 0.62rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #0b0f17;
}
.notif-wrap, .user-wrap { position: relative; }

/* Popover (alertas + menu do usuário) */
.appbar-pop {
    display: none;
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 320px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 12px 28px -6px rgba(0,0,0,0.55);
    padding: 0.85rem; z-index: 210;
}
.appbar-pop.open { display: block; }
.appbar-pop-right { width: 240px; }
.appbar-pop-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.82rem; font-weight: 600; color: var(--text-primary);
    border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 0.5rem;
}
.appbar-pop-head .muted { font-size: 0.72rem; color: var(--text-secondary); font-weight: 400; }
.appbar-pop-empty { font-size: 0.78rem; color: var(--text-secondary); text-align: center; margin: 1.2rem 0; }
.appbar-pop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; max-height: 260px; overflow-y: auto; }
.appbar-pop-list li { display: flex; gap: 0.5rem; font-size: 0.76rem; color: var(--text-secondary); line-height: 1.35; border-bottom: 1px dashed rgba(255,255,255,0.06); padding-bottom: 0.5rem; }
.appbar-pop-list li i { color: var(--warning); margin-top: 2px; }
.appbar-pop-list li small { display: block; color: rgba(255,255,255,0.3); font-size: 0.62rem; margin-top: 2px; }
.appbar-pop-btn { width: 100%; margin-top: 0.6rem; padding: 0.45rem; font-size: 0.75rem; border: none; border-radius: 8px; background: var(--primary); color: #fff; cursor: pointer; font-weight: 600; }

/* Menu do usuário */
.user-btn { display: flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.4rem; border-radius: 999px; background: none; border: none; cursor: pointer; }
.user-btn:hover { background: rgba(255,255,255,0.06); }
.user-av { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,0,127,0.15); color: #ff5aa8; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 600; flex-shrink: 0; }
.user-av.lg { width: 40px; height: 40px; font-size: 0.85rem; }
.user-caret { font-size: 0.7rem; color: var(--text-secondary); }
.user-menu-head { display: flex; align-items: center; gap: 0.6rem; padding-bottom: 0.6rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.user-menu-head b { display: block; font-size: 0.82rem; color: var(--text-primary); }
.user-menu-head span { font-size: 0.66rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.user-menu-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.6rem; border-radius: 8px; color: var(--text-secondary); font-size: 0.82rem; }
.user-menu-item:hover { background: rgba(255,255,255,0.05); color: #fff; }

/* Recolher a sidebar (DESKTOP): o hambúrguer esconde a barra fixa. */
body.nav-collapsed .sidebar { transform: translateX(-100%); }
body.nav-collapsed .main-content { margin-left: 0; }

/* Backdrop da gaveta: invisível por padrão; só entra no mobile com nav-open. */
.nav-backdrop {
    display: none;
    position: fixed; inset: 56px 0 0 0;   /* abaixo da appbar */
    background: rgba(3, 6, 12, 0.6);
    z-index: 150;                          /* acima do conteúdo, abaixo da sidebar (fixa é 100, mas subimos a sidebar no mobile) */
}

/* ===== Tablet + celular: sidebar vira gaveta off-canvas ===== */
@media (max-width: 1024px) {
    /* A sidebar sai da tela por padrão e passa a flutuar sobre o conteúdo. */
    .sidebar {
        transform: translateX(-100%);
        z-index: 160;                      /* acima do backdrop (150) */
        box-shadow: 8px 0 24px rgba(0,0,0,0.4);
    }
    .main-content { margin-left: 0; }      /* conteúdo ocupa tudo */

    /* nav-collapsed é um conceito de DESKTOP: aqui não vale nada. */
    body.nav-collapsed .sidebar { transform: translateX(-100%); }

    /* Aberta: desliza para dentro e acende o backdrop. */
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .nav-backdrop { display: block; }

    .content-body { padding: 1.5rem; }

    /* Sem menu fixo embaixo: a zona da marca volta à largura natural, sem a borda. */
    .appbar-lead { width: auto; border-right: none; padding: 0 0.4rem; }
    .appbar-search-wrap { margin-left: 0.6rem; }
}

/* ===== Celular: aperto extra ===== */
@media (max-width: 640px) {
    .appbar { gap: 0.5rem; padding: 0 0.6rem; }
    .appbar-search-wrap { display: none; }
    /* Marca encurta: esconde " Shelf Audit", fica só "Squadra". */
    .appbar-brand span { display: none; }
    .tenant-pill { padding: 0.3rem 0.5rem; }
    .tenant-pill select { max-width: 96px; }
    .appbar-pop { width: calc(100vw - 24px); right: -6px; }   /* dropdown não estoura a tela */
    .content-body { padding: 1rem; }
    /* Alvos de toque confortáveis. */
    .appbar-ham, .appbar-ic { min-width: 44px; min-height: 44px; }

    /* --- IMPORTANTE: tudo abaixo é ESCOPADO a .main-content (o chrome do admin).
           camera.php, index.php do promotor e login.php carregam o mesmo app.css
           mas NÃO têm .main-content — então estas regras nunca os alcançam. --- */
    /* Painéis mais compactos no celular. */
    .main-content .panel { padding: 1.25rem; }
    /* Cabeçalho do painel (título + ações) quebra em vez de estourar. */
    .main-content .panel-header { flex-wrap: wrap; gap: 0.75rem; }
    /* Tabelas mais densas; a rolagem horizontal fica no .table-responsive. */
    .main-content .table th, .main-content .table td { padding: 0.6rem 0.7rem; font-size: 0.8rem; }
    .main-content .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    /* Grid de mapeamento do importador CSV (produtos/lojas) vira 1 coluna. */
    .main-content #wiz-map-grid { grid-template-columns: 1fr !important; }
    /* Botões não estouram a largura. */
    .main-content .btn { max-width: 100%; }

    /* --- Telas de edição (é para onde a busca leva): grids de campo de 2–3
           colunas viram 1 coluna; grids responsivos (auto-fit/fill) não casam
           com estes seletores e continuam se ajustando sozinhos. --- */
    .main-content form [style*="grid-template-columns: 1fr 1fr"],
    .main-content form [style*="grid-template-columns: 1fr 2fr"],
    .main-content form [style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    /* Campos ocupam a largura toda; libera min-width inline que estoura. */
    .main-content form select, .main-content form input,
    .main-content form textarea, .main-content form .form-control {
        min-width: 0 !important;
        max-width: 100%;
    }
}

.topbar {
    height: 70px;
    background-color: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 90;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.content-body {
    padding: 2.5rem;
    flex-grow: 1;
}

/* Tenant Context Switcher */
.tenant-switcher-form select {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: var(--font-sans);
}

/* Dashboard Analytics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

.metric-card.success::after { background: var(--success); }
.metric-card.danger::after { background: var(--danger); }
.metric-card.warning::after { background: var(--warning); }

.metric-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.metric-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Analytical Panels */
.dashboard-panels {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-panels {
        grid-template-columns: 1fr;
    }
}

.panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Table Style */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: rgba(255,255,255,0.02);
}

/* Badge styling */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background-color: rgba(34, 197, 94, 0.15); color: #86EFAC; }
.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: #FCA5A5; }
.badge-warning { background-color: rgba(245, 158, 11, 0.15); color: #FDE047; }
.badge-primary { background-color: rgba(37, 99, 235, 0.15); color: #93C5FD; }

/* Filter bar styles */
.filter-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.filter-group select, .filter-group input {
    background-color: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
}

.filter-group select:focus, .filter-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Promoter UI */
.promoter-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-main);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.promoter-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.promoter-content {
    flex-grow: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.promoter-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* Real-time Camera Layout */
.camera-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #000;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#camera-canvas {
    display: none;
}

/* On-device prompt overlay */
.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    padding: 1rem;
}

.validation-box {
    align-self: center;
    width: 85%;
    height: 65%;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 0.75rem;
    position: absolute;
    top: 17.5%;
    left: 7.5%;
    transition: border-color 0.3s ease;
}

.validation-box.valid {
    border-color: var(--success);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.validation-box.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.indicators-panel {
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    pointer-events: auto;
    font-size: 0.75rem;
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #64748B;
}

.indicator.valid { color: #86EFAC; }
.indicator.valid .indicator-dot { background-color: var(--success); box-shadow: var(--glow-success); }
.indicator.invalid { color: #FCA5A5; }
.indicator.invalid .indicator-dot { background-color: var(--danger); }

/* Capture Action buttons */
.camera-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.btn-capture {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #FFF;
    border: 5px solid var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.btn-capture:hover:not(:disabled) {
    transform: scale(1.05);
    background-color: #E2E8F0;
}

.btn-capture:disabled {
    background-color: #475569;
    border-color: #334155;
    cursor: not-allowed;
}

/* Real-time Analysis Feedback Modal */
.api-feedback {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1rem;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Reorderable Dashboard Panels */
.dashboard-reorderable-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.draggable-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.draggable-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--primary) !important;
    box-shadow: var(--glow-primary) !important;
    transform: scale(0.99);
}

.draggable-card .panel-header {
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.draggable-card .panel-header:active {
    cursor: grabbing;
}

.panel-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.grip-icon {
    color: var(--text-secondary);
    cursor: grab;
    padding: 0.25rem;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.grip-icon:hover {
    color: var(--primary);
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reorder-buttons {
    display: flex;
    gap: 0.25rem;
}

.btn-reorder {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-reorder:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: rgba(255, 0, 127, 0.1);
    box-shadow: 0 0 8px rgba(255, 0, 127, 0.2);
}
