/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary:    #3698d3;
    --color-primary-h:  #3698d3;
    --color-danger:     #dc2626;
    --color-success:    #16a34a;
    --color-bg:         #f1f5f9;
    --color-sidebar:    #1e293b;
    --color-sidebar-t:  #94a3b8;
    --color-text:       #0f172a;
    --color-text-soft:  #64748b;
    --color-border:     #e2e8f0;
    --color-white:      #ffffff;
    --radius:           8px;
    --shadow:           0 1px 3px rgba(0,0,0,.12);
    --sidebar-w:        240px;
    --admin-topbar-h:   52px;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ─── Login Page ────────────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-bg);
}

.login-wrapper { width: 100%; max-width: 400px; padding: 1rem; }

.login-box {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
    background: var(--color-sidebar);
    border-radius: var(--radius);
    padding: 1.25rem 2rem 1rem;
}
.login-logo img {
    height: 38px;
    width: auto;
    display: block;
    margin: 0 auto .5rem;
}
.login-logo span {
    font-size: 0.8rem;
    color: #3698d3;
}

/* ─── Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: .4rem;
    color: var(--color-text);
}

.form-group .acesso-escaloes label {
    display: inline-flex;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .6rem .9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-white);
    transition: border-color .15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    text-decoration: none;
}
.btn-primary  { background: var(--color-primary);  color: #fff; }
.btn-primary:hover  { background: var(--color-primary-h); }
.btn-danger   { background: var(--color-danger);   color: #fff; }
.btn-success  { background: var(--color-success);  color: #fff; }
.btn-outline  { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn-outline:hover { background: var(--color-bg); }
.btn-block    { width: 100%; justify-content: center; padding: .75rem; }
.btn-download { background: var(--color-primary); color: #fff; font-size: 0.85rem; }
.btn-download:hover { background: var(--color-primary-h); }

/* ─── Alerts ────────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.alert-error   { background: #fef2f2; color: var(--color-danger);  border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--color-success); border: 1px solid #bbf7d0; }

/* ─── App Layout ─────────────────────────────────────────────────── */
.app-page { display: block; min-height: 100vh; }

/* Sidebar — kept for reference but no longer rendered */
.sidebar { display: none; }

.sidebar-badge {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 99px;
    padding: .1rem .45rem;
    margin-left: .4rem;
    vertical-align: middle;
    line-height: 1.4;
}

.btn-logout {
    color: var(--color-danger) !important;
    font-size: 0.85rem;
}

/* ─── Admin top navbar ───────────────────────────────────────────── */
.admin-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--admin-topbar-h);
    z-index: 150;
    background: var(--color-sidebar);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: .5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.admin-topbar-brand {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.01em;
    flex-shrink: 0;
    margin-right: .5rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.admin-topbar-brand small {
    font-size: .68rem;
    font-weight: 400;
    color: #3698d3;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ─── Logo SVG nas navbars ───────────────────────────────────────── */
.topbar-logo {
    height: 26px;
    width: auto;
    display: block;
    flex-shrink: 0;
}
.drawer-logo {
    height: 22px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.admin-topbar-nav {
    display: flex;
    align-items: stretch;
    flex: 1;
    height: 100%;
    overflow: hidden;
}

.admin-topbar-link {
    display: flex;
    align-items: center;
    padding: 0 .7rem;
    color: var(--color-sidebar-t);
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
    height: 100%;
}
.admin-topbar-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.admin-topbar-link.active {
    color: #fff;
    border-bottom-color: var(--color-primary);
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: auto;
    flex-shrink: 0;
}
.admin-topbar-email {
    font-size: .78rem;
    color: #475569;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main Content */
.main-content {
    margin-left: 0;
    padding: calc(var(--admin-topbar-h) + 1.5rem) 2rem 2rem;
    min-width: 0;
}

.page-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}
.page-header h1 { font-size: 1.5rem; font-weight: 600; }

/* ─── Stats Grid (Admin Dashboard) ──────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.stat-number { font-size: 2rem; font-weight: 700; color: var(--color-primary); }
.stat-label  { font-size: 0.85rem; color: var(--color-text-soft); }

/* ─── Ficheiros Grid (User Dashboard) ───────────────────────────── */
.ficheiros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.ficheiro-card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ficheiro-icon {
    width: 48px; height: 48px;
    border-radius: 6px;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.ficheiro-icon.ext-pdf  { background: #dc2626; }
.ficheiro-icon.ext-zip  { background: #d97706; }
.ficheiro-icon.ext-xlsx { background: #16a34a; }
.ficheiro-icon.ext-docx { background: #3698d3; }

.ficheiro-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}
.ficheiro-nome {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ficheiro-marca,
.ficheiro-data {
    font-size: 0.78rem;
    color: var(--color-text-soft);
}

/* ─── Empty State ────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-soft);
}

/* ─── Page Header with action button ────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── Tables ─────────────────────────────────────────────────────── */
.table-wrap {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table thead tr {
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
}

.table th {
    padding: .75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-soft);
    white-space: nowrap;
}

.table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.table.padded td {
    padding: 24px 16px;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }

.table td.actions > * {
    margin-right: .5rem;
}
.table td.actions > *:last-child {
    margin-right: 0;
}

.btn-sm { padding: .35rem .75rem; font-size: 0.8rem; }

.btn-notify:hover,
.btn-notify { background: #f8ff99;}


/* ─── Badges ─────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-bg);
    color: var(--color-text-soft);
    border: 1px solid var(--color-border);
}
.badge-primary {
    background: #dbeafe;
    color: var(--color-primary);
    border-color: #bfdbfe;
}

/* ─── Text helpers ───────────────────────────────────────────────── */
.text-soft { color: var(--color-text-soft); }

/* ─── Modals ─────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 { font-size: 1.1rem; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--color-text-soft);
    padding: .25rem;
    line-height: 1;
}
.modal-close:hover { color: var(--color-text); }

.modal form { padding: 1.5rem; }
.modal form .form-group:last-of-type { margin-bottom: 0; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
    margin-top: 1.25rem;
}

/* ─── Modal largo ────────────────────────────────────────────────── */
.modal-lg { max-width: 620px; }

/* ─── Upload Area ────────────────────────────────────────────────── */
.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: var(--color-bg);
}
.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--color-primary);
    background: #eff6ff;
}
.upload-icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.upload-area p { color: var(--color-text); font-size: .95rem; }
.upload-area small { color: var(--color-text-soft); }

/* ─── Checkbox group ─────────────────────────────────────────────── */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    max-height: 200px;
    overflow-y: auto;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    cursor: pointer;
}
.checkbox-label input[type=checkbox] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;          /* Safari reset — remove margens padrão */
    flex-shrink: 0;     /* não encolher em flex */
    align-self: center; /* alinhamento vertical fiável no Safari */
}

/* ─── Form hint ──────────────────────────────────────────────────── */
.form-hint {
    display: block;
    margin-top: .3rem;
    font-size: .8rem;
    color: var(--color-text-soft);
}

/* ─── Progress bar ───────────────────────────────────────────────── */
.progress-bar-wrap {
    background: var(--color-border);
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
    margin-bottom: .4rem;
}
.progress-bar {
    height: 100%;
    background: var(--color-primary);
    width: 0%;
    transition: width .3s;
    animation: progressPulse 1.5s infinite;
}
@keyframes progressPulse {
    0%   { width: 20%; }
    50%  { width: 80%; }
    100% { width: 95%; }
}

/* ─── User Dashboard — secções por marca ────────────────────────── */
.marca-section {
    margin-bottom: 2.5rem;
}

.marca-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
}

/* ─── Badge NOVO ─────────────────────────────────────────────────── */
.ficheiro-card.is-novo {
    position: relative;
}

.ficheiro-card.is-novo::after {
    content: 'NOVO';
    position: absolute;
    top: -8px;
    right: 10px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: .15rem .45rem;
    border-radius: 99px;
    animation: novoBlink 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes novoBlink {
    0%   { opacity: 1;   box-shadow: 0 0 0 0 rgba(37,99,235,.5); }
    50%  { opacity: .75; box-shadow: 0 0 0 5px rgba(37,99,235,0); }
    100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(37,99,235,.5); }
}

/* ═══════════════════════════════════════════════════════════════════
   USER AREA — layout independente (sem sidebar)
   ═══════════════════════════════════════════════════════════════════ */

.user-page {
    background: #f1f5f9;
    min-height: 100vh;
    display: block;
}

/* ── Header ──────────────────────────────────────────────────────── */
.user-header {
    background: #1e293b;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.user-header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: .9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.user-header-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.01em;
}
.user-header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.user-header-empresa {
    font-size: .85rem;
    color: #94a3b8;
}
.btn-user-logout {
    font-size: .85rem;
    color: #f87171;
    text-decoration: none;
    padding: .35rem .75rem;
    border: 1px solid rgba(248,113,113,.3);
    border-radius: 6px;
    transition: background .15s;
}
.btn-user-logout:hover { background: rgba(248,113,113,.1); }

/* ── Main container ──────────────────────────────────────────────── */
.user-main { padding: 2rem 1.5rem 3rem; }
.user-container {
    max-width: 1300px;
    margin: 0 auto;
}
.user-empty {
    text-align: center;
    padding: 4rem;
    color: #64748b;
    font-size: 1rem;
}

/* ── Grid de marcas ──────────────────────────────────────────────── */
.marcas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

/* ── Card de marca ───────────────────────────────────────────────── */
.marca-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s;
}
.marca-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06);
}

.marca-card-header {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
    padding: 1rem 1.25rem .85rem;
    border-bottom: 1px solid #f1f5f9;
    min-height: 72px;
}

/* Wrapper da logo — largura fixa, altura máx sem crop */
.marca-card-logo-wrap {
    flex-shrink: 0;
    width: auto;
    max-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Imagem: respeita proporção, não corta */
.marca-card-logo-img {
    max-width: 130px;
    width: auto;
    height: 52px;
    object-fit: contain;
    display: block;
}

/* Placeholder tipo Google — inicial da marca */
.marca-card-logo-initial {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.marca-card-nome {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

/* ── Lista de ficheiros ──────────────────────────────────────────── */
.marca-card-ficheiros {
    padding: .5rem 0 .75rem;
    flex: 1;
}

.ficheiro-grupo-label {
    padding: .45rem 1.25rem .3rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #64748b;
}

.ficheiro-linha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .45rem 1.25rem;
    text-decoration: none;
    color: #0f172a;
    font-size: .88rem;
    border-bottom: 1px solid #f8fafc;
    transition: background .1s;
    position: relative;
    padding-bottom: 1.4rem;
    min-height: 55px;
}
.ficheiro-linha:last-child { border-bottom: none; }
.ficheiro-linha:hover {
    background: #eff6ff;
    color: var(--color-primary);
}
.ficheiro-linha:hover .ficheiro-linha-dl {
    opacity: 1;
    color: var(--color-primary);
}

.ficheiro-linha-nome {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: .5rem;
}

.ficheiro-linha-data {
    display: inline;
    position: absolute;
    left: 20px;
    top: 29px;
    font-size: 10px;
    font-style: italic;
    color: var(--color-sidebar-t);
    font-weight: 400;
}

.ficheiro-linha-dl {
    position: relative;
    top: 5px;
    font-size: 1rem;
    opacity: .3;
    flex-shrink: 0;
    transition: opacity .1s;
}

/* ── Badge NOVO ──────────────────────────────────────────────────── */
.ficheiro-linha.is-novo .ficheiro-linha-nome::after {
    content: 'NOVO';
    display: inline-block;
    margin-left: .5rem;
    background: var(--color-primary);
    color: #fff;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: .1rem .4rem;
    border-radius: 99px;
    vertical-align: middle;
    animation: novoBlink 2s ease-in-out infinite;
}

@keyframes novoBlink {
    0%   { opacity: 1;   box-shadow: 0 0 0 0 rgba(37,99,235,.5); }
    50%  { opacity: .8;  box-shadow: 0 0 0 4px rgba(37,99,235,0); }
    100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(37,99,235,.5); }
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .marcas-grid {
        grid-template-columns: 1fr;
    }
    .user-main { padding: 1rem .75rem 2rem; }
    .user-header-inner { padding: .75rem 1rem; }
    .user-header-empresa { display: none; }
}
@media (min-width: 641px) and (max-width: 960px) {
    .marcas-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Burger menu ─────────────────────────────────────────────────── */
.burger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s;
}
.burger-btn:hover { background: rgba(255,255,255,.09); }
.burger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.burger-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    backdrop-filter: blur(2px);
}
.burger-overlay.is-open { display: block; }

.burger-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: #1e293b;
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: -4px 0 24px rgba(0,0,0,.25);
}
.burger-drawer.is-open { transform: translateX(0); }

.burger-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.burger-drawer-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.01em;
}
.burger-drawer-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.burger-drawer-close:hover { background: rgba(255,255,255,.08); color: #fff; }

.burger-drawer-nav {
    flex: 1;
    padding: .5rem 0;
    overflow-y: auto;
}
.burger-drawer-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1.25rem;
    color: #cbd5e1;
    font-size: .95rem;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background .12s, color .12s;
    line-height: 1;
}
.burger-drawer-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.burger-drawer-link.is-active { color: #fff; background: rgba(255,255,255,.07); }

.burger-drawer-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 1rem 1.25rem;
    flex-shrink: 0;
}
.burger-drawer-empresa {
    font-size: .75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.burger-drawer-logout {
    display: inline-block;
    color: #f87171;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    padding: .45rem 0;
    transition: color .15s;
}
.burger-drawer-logout:hover { color: #fca5a5; }

/* ── Header — botão password ─────────────────────────────────────── */
.btn-user-pwd {
    font-size: .85rem;
    color: #94a3b8;
    background: none;
    border: 1px solid rgba(148,163,184,.3);
    border-radius: 6px;
    padding: .35rem .75rem;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.btn-user-pwd:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ── Modal password ──────────────────────────────────────────────── */
.modal-pwd { max-width: 420px; }

.pwd-input-wrap {
    position: relative;
}
.pwd-input-wrap input {
    padding-right: 2.5rem;
}
.pwd-toggle {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: .4;
    padding: 0;
    line-height: 1;
    transition: opacity .15s;
}
.pwd-toggle:hover { opacity: .8; }

.pwd-strength {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .4rem;
}
.pwd-strength-bar {
    height: 4px;
    border-radius: 99px;
    width: 0%;
    transition: width .3s, background .3s;
    flex: 1;
    background: #e2e8f0;
}
.pwd-strength-label {
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

.pwd-match-msg {
    display: block;
    margin-top: .3rem;
    font-size: .8rem;
    font-weight: 500;
}

.pwd-aviso {
    font-size: .82rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: .6rem .9rem;
    margin-bottom: .5rem;
}

/* ─── Admin responsive ───────────────────────────────────────────── */
@media (min-width: 1000px) {
    /* Desktop: show inline nav, hide burger */
    .admin-topbar-nav   { display: flex; }
    .admin-topbar-right { display: flex; }
    .admin-topbar .burger-btn { display: none; }
}

@media (max-width: 999px) {
    /* Mobile: hide inline nav, show burger */
    .admin-topbar-nav   { display: none; }
    .admin-topbar-right { display: none; }
    .admin-topbar .burger-btn { display: flex; margin-left: auto; }

    .main-content {
        padding: calc(var(--admin-topbar-h) + 1rem) 1rem 2rem;
    }

    .page-header {
        flex-wrap: wrap;
        gap: .75rem;
    }
    .page-header h1 { font-size: 1.2rem; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: .75rem;
    }

    .table td.actions {

    }
    .table td.actions > * { margin-right: 0; }

    table td.actions button {
        display: block;
        min-width: 100px;
        margin: 20px 0px;
        min-height: 37px;
    }
}
