/* =====================
   Reset
===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }

/* =====================
   Variáveis
===================== */
:root {
    --sidebar-w:           220px;
    --sidebar-collapsed-w: 56px;
    --topbar-h:            56px;
    --sidebar-bg:          #1a1a2e;
    --sidebar-text:        #b0b8c8;
    --bg:                  #f0f2f5;
    --surface:             #ffffff;
    --border:              #e2e6ea;
    --text:                #333;
}

/* =====================
   Base
===================== */
body {
    font-family: Arial, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
}

/* =====================
   Sidebar
===================== */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.2s ease;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

.sidebar-header {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.sidebar-logo  { font-weight: bold; font-size: 1rem; color: #fff; white-space: nowrap; }
.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    flex-shrink: 0;
}
.sidebar-toggle:hover { color: #fff; }

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    white-space: nowrap;
    transition: background 0.15s;
}
.nav-item:hover  { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.12); color: #fff; }
.nav-item .material-symbols-outlined { font-size: 20px; flex-shrink: 0; }

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}
/* Garante que o ícone do usuário nunca seja esmagado (encolhido) pelo texto grande */
.sidebar-footer .material-symbols-outlined {
    flex-shrink: 0;
}

/* Aplica a quebra de linha flexível apenas ao texto do rodapé */
.sidebar-footer .text {
    white-space: normal; /* Sobrescreve o 'nowrap' herdado do pai */
    overflow-wrap: break-word; /* Quebra palavras muito grandes */
    word-break: break-word; /* Evita o 'break-all' que pode quebrar palavras curtas ao meio sem necessidade */
    line-height: 1.3; /* Melhora a legibilidade caso ocupe 2 ou mais linhas */
    flex: 1; /* Faz o texto ocupar o espaço disponível corretamente */
}

/* Esconde labels de texto quando colapsado */
.sidebar.collapsed .text { display: none; }

/* =====================
   Backdrop (mobile)
===================== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
}
.sidebar-backdrop.is-visible { display: block; }

/* =====================
   Page wrapper
===================== */
.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

/* =====================
   Topbar
===================== */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    flex-shrink: 0;
}
.topbar-title { font-weight: bold; font-size: 0.95rem; flex: 1; }
.topbar-right  { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.topbar-right a:hover { color: #888; }

.mobile-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    align-items: center;
    color: var(--text);
    padding: 4px;
}

/* =====================
   Main content
===================== */
.main-content {
    flex: 1;
    padding: 28px 24px;
}

/* =====================
   Footer
===================== */
.site-footer {
    padding: 14px 24px;
    font-size: 0.8rem;
    color: #999;
    border-top: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
}

/* =====================
   Botões
===================== */
.btn {
    display: inline-block;
    padding: 8px 18px;
    background: var(--sidebar-bg);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn:hover    { opacity: 0.85; }
.btn-full     { width: 100%; text-align: center; padding: 12px; }

/* =====================
   Cards (home)
===================== */
.hero          { margin-bottom: 24px; }
.hero h1       { font-size: 1.7rem; margin-bottom: 6px; }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.card h2 { font-size: 1rem; }

/* =====================
   Login (página isolada)
===================== */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.login-box h1  { font-size: 1.3rem; }
.form-group    { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 0.85rem; font-weight: bold; }
.form-group input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
}
.form-group input:focus { outline: none; border-color: var(--sidebar-bg); }
.error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* =====================
   Alerts
===================== */
.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    font-size: 0.92rem;
}
.alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #166534;
}
.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* =====================
   Page header
===================== */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-header h1 { font-size: 1.4rem; flex: 1; }

/* =====================
   Badges
===================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: bold;
    border: none;
    cursor: default;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-error   { background: #fee2e2; color: #991b1b; }
.badge-plan {
    position: relative;
    overflow: hidden;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.35);
    cursor: default;
    vertical-align: middle;
}

/* Reflexo de brilho — apenas planos Growth (mais caros) */
.badge-plan--growth::after {
    content: '';
    position: absolute;
    top: -10%;
    left: 0;
    width: 45%;
    height: 120%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255,255,255,.55) 50%,
        transparent 100%
    );
    transform: translateX(-160%) skewX(-18deg);
    animation: badge-plan-shine 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes badge-plan-shine {
    0%   { transform: translateX(-160%) skewX(-18deg); opacity: 0; }
    4%   { opacity: 1; }
    30%  { transform: translateX(260%) skewX(-18deg); opacity: 0; }
    100% { transform: translateX(260%) skewX(-18deg); opacity: 0; }
}

/* =====================
   Toolbar / search
===================== */
.toolbar { margin-bottom: 16px; }
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.filter-select {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
    color: var(--text);
}
.filter-select:focus { outline: none; border-color: var(--sidebar-bg); }
.search-input {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    width: 100%;
    max-width: 360px;
}
.search-input:focus { outline: none; border-color: var(--sidebar-bg); }

/* =====================
   Table
===================== */
.table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow-x: auto;
    /* overflow-x: auto está no .table-scroll interno para não cortar dropdowns absolutos */
    overflow: visible;
}
.table-scroll {
    overflow-x: auto;
    border-radius: 6px;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
thead { background: #f8f9fa; }
th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }

.table-empty { padding: 32px; text-align: center; color: #999; font-size: 0.9rem; }

.client-cell { display: flex; align-items: center; gap: 12px; }
.client-cell small { display: block; color: #999; font-size: 0.8rem; margin-top: 2px; }

.avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: #555;
    flex-shrink: 0;
    overflow: visible;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.status-dot {
    position: absolute;
    bottom: 0; right: 0;
    width: 11px; height: 11px;
    border-radius: 50%;
    border: 2px solid #fff;
}
.status-dot.active   { background: #22c55e; }
.status-dot.inactive { background: #f87171; }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f8f9fa; opacity: 1; }
.btn-danger {
    background: #d32f2f;
    color: #fff;
    border: 1px solid #b71c1c;
}
.btn-danger:hover { background: #b71c1c; opacity: 1; }
.danger-zone {
    border-color: #d32f2f;
}
.danger-zone legend {
    color: #d32f2f;
}
.actions { text-align: right; white-space: nowrap; }

/* =====================
   Forms
===================== */
.form-shell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}
.form-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}
.form-section legend {
    padding: 0 8px;
    font-weight: bold;
    font-size: 0.95rem;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-field-full { grid-column: 1 / -1; }
.form-field label {
    font-size: 0.85rem;
    font-weight: bold;
}
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--sidebar-bg);
}
.form-field input[hidden] { display: none; }
.input-action-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.input-action-row input { flex: 1; }
.btn-generate {
    white-space: nowrap;
    min-width: 92px;
}
/* =====================
   Filtros inline no cabeçalho da tabela
===================== */
th.th-filterable { position: relative; }

.th-filter-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.th-filter-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 3px;
    border-radius: 4px;
    color: #ccc;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}
.th-filter-btn .material-symbols-outlined { font-size: 15px; }
.th-filter-btn:hover  { color: var(--sidebar-bg); background: rgba(0,0,0,0.06); }
.th-filter-btn.is-active { color: var(--sidebar-bg); }

.th-filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.th-filter-dropdown[hidden] { display: none; }

.th-filter-dropdown input,
.th-filter-dropdown select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.88rem;
    background: #fff;
    color: var(--text);
}
.th-filter-dropdown input:focus,
.th-filter-dropdown select:focus { outline: none; border-color: var(--sidebar-bg); }

.th-filter-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.th-filter-actions {
    display: flex;
    gap: 6px;
    padding-top: 2px;
}

/* Input com prefixo/sufixo (ex: .kommo.com) */
.input-addon-wrap {
    display: flex;
    align-items: stretch;
}
.input-addon-wrap input {
    flex: 1;
    border-radius: 6px 0 0 6px;
    border-right: none;
    min-width: 0;
}
.input-addon-wrap input:focus {
    outline: none;
    border-color: var(--sidebar-bg);
    z-index: 1;
}
.addon {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #f0f2f5;
    border: 1px solid var(--border);
    font-size: 0.88rem;
    color: #666;
    white-space: nowrap;
    user-select: none;
}
.addon.suffix { border-radius: 0 6px 6px 0; border-left: none; }
.addon.prefix { border-radius: 6px 0 0 6px; border-right: none; }
.field-hint {
    display: block;
    color: #666;
    font-size: 0.8rem;
    line-height: 1.4;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}
.form-header { margin-bottom: 24px; }
.form-title  { font-size: 1.15rem; font-weight: 700; color: #1a1a2e; margin-bottom: 6px; }
.form-subtitle { color: #666; font-size: .88rem; }
.form-section-title {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #888;
    margin-bottom: 14px;
}
.required { color: #e53e3e; margin-left: 2px; }

/* ── Upload page ── */
.upload-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.upload-page-header h1 { margin: 0; }

/* ── Client cards (visão interna — lista de doutores) ── */
.client-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.client-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow .15s, border-color .15s;
}
.client-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    border-color: var(--sidebar-bg);
}
.client-card-name { font-weight: 600; font-size: 1rem; }
.client-card-meta { font-size: 0.82rem; color: #888; }
.client-card-drive {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
}
.drive-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 600;
}
.drive-badge-ok  { background: #e6f4ea; color: #1e7e34; }
.drive-badge-no  { background: #fce8e8; color: #c0392b; }

/* ── Upload command palette (visão interna — lista de doutores) ── */
.ucl-topbar {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 18px;
}
.ucl-topbar h1 { margin: 0; }
.ucl-topbar-count {
    font-size: 0.82rem;
    color: #aaa;
}
.ucl-layout {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    height: calc(100vh - 148px);
    min-height: 420px;
}

/* Left panel */
.ucl-list {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.ucl-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}
.ucl-search .material-symbols-outlined {
    font-size: 18px;
    color: #bbb;
    flex-shrink: 0;
}
.ucl-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.88rem;
    color: var(--text);
    min-width: 0;
}
.ucl-search input::placeholder { color: #bbb; }
.ucl-search-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}
.ucl-search-clear:hover { color: #888; }
.ucl-search-clear .material-symbols-outlined { font-size: 16px; }

.ucl-items {
    flex: 1;
    overflow-y: auto;
}
.ucl-empty {
    padding: 32px 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #bbb;
}
.ucl-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
    user-select: none;
}
.ucl-item:last-child { border-bottom: none; }
.ucl-item:hover  { background: #f5f7ff; }
.ucl-item.active { background: #eef1ff; }
.ucl-initial {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    color: #fff;
    flex-shrink: 0;
}
.ucl-item-info {
    flex: 1;
    min-width: 0;
}
.ucl-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ucl-item-meta {
    font-size: 0.74rem;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.ucl-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ucl-dot-ok { background: #2ecc71; }
.ucl-dot-no { background: #ddd; }

/* Pagination inside list */
.ucl-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
}
.ucl-page-btn {
    font-size: 0.78rem;
    color: var(--sidebar-bg);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 5px;
    transition: background .1s;
}
.ucl-page-btn:hover { background: #eef1ff; }
.ucl-page-btn.disabled { color: #ccc; pointer-events: none; }
.ucl-page-info { font-size: 0.78rem; color: #aaa; }

/* Right detail panel */
.ucl-detail {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 48px;
    overflow-y: auto;
    align-self: stretch;
}
.ucl-placeholder {
    text-align: center;
    color: #d0d5e0;
}
.ucl-placeholder .material-symbols-outlined {
    font-size: 56px;
    display: block;
    margin-bottom: 12px;
}
.ucl-placeholder p {
    font-size: 0.88rem;
    margin: 0;
}
.ucl-detail-content {
    width: 100%;
    max-width: 360px;
    animation: uclFadeIn .18s ease;
}
@keyframes uclFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ucl-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 18px;
}
.ucl-detail-name {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 6px;
    color: var(--text);
}
.ucl-detail-meta {
    font-size: 0.88rem;
    color: #999;
    margin-bottom: 28px;
}
.ucl-detail-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: var(--text);
    background: #fafbfc;
}
.ucl-detail-status .material-symbols-outlined { font-size: 20px; }
.ucl-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--sidebar-bg);
    color: #fff;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity .15s, transform .1s;
}
.ucl-detail-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}
.ucl-detail-btn .material-symbols-outlined { font-size: 18px; }

/* ── Dropzone ── */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: var(--surface);
}
.upload-dropzone.drag-over {
    border-color: var(--sidebar-bg);
    background: #f0f4ff;
}
.upload-dropzone .dz-icon {
    font-size: 48px;
    color: #b0b8c8;
    margin-bottom: 12px;
}
.upload-dropzone p { margin: 4px 0; color: #666; }
.upload-dropzone .dz-hint { font-size: 0.82rem; color: #aaa; }

/* ── Lista de arquivos selecionados ── */
.upload-file-list { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.upload-file-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.upload-file-item .fi-icon { font-size: 28px; color: var(--sidebar-bg); flex-shrink: 0; }
.upload-file-item .fi-info { flex: 1; min-width: 0; }
.upload-file-item .fi-name-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.88rem;
    background: #f8f9fa;
}
.upload-file-item .fi-name-input:focus { outline: none; border-color: var(--sidebar-bg); background: #fff; }
.upload-file-item .fi-ext { font-size: 0.78rem; color: #aaa; margin-top: 2px; }
.upload-file-item .fi-remove {
    background: none; border: none; cursor: pointer;
    color: #ccc; font-size: 20px; padding: 4px;
    transition: color .15s;
}
.upload-file-item .fi-remove:hover { color: #c0392b; }
.upload-progress { height: 4px; background: #e2e6ea; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.upload-progress-bar { height: 100%; background: var(--sidebar-bg); width: 0; transition: width .3s; }

/* ── Anotação ── */
.upload-note-wrap { margin-top: 20px; }
.upload-note-wrap label { font-weight: 600; display: block; margin-bottom: 6px; }
.upload-note-wrap textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    box-sizing: border-box;
}
.upload-note-wrap textarea:focus { outline: none; border-color: var(--sidebar-bg); }

/* ── Botão de envio ── */
.upload-submit-row { margin-top: 20px; display: flex; gap: 12px; align-items: center; }
.upload-status-msg { font-size: 0.88rem; }
.upload-status-msg.ok    { color: #1e7e34; }
.upload-status-msg.error { color: #c0392b; }

/* ── Histórico / Drive tree ── */
.drive-section { margin-top: 40px; }
.drive-section h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; }
.drive-empty { text-align: center; color: #aaa; padding: 40px; font-size: 0.95rem; }
.drive-year  { margin-bottom: 12px; }
.drive-year-toggle {
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    font-size: 1rem; font-weight: 700; color: var(--text);
    padding: 8px 0;
}
.drive-year-toggle .material-symbols-outlined { font-size: 20px; transition: transform .2s; }
.drive-year-toggle.open .material-symbols-outlined { transform: rotate(90deg); }
.drive-months { display: none; padding-left: 16px; }
.drive-months.open { display: block; }
.drive-month { margin-bottom: 8px; }
.drive-month-toggle {
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    font-size: 0.92rem; font-weight: 600; color: #555;
    padding: 4px 0;
}
.drive-month-toggle .material-symbols-outlined { font-size: 18px; transition: transform .2s; }
.drive-month-toggle.open .material-symbols-outlined { transform: rotate(90deg); }
.drive-days { display: none; padding-left: 14px; }
.drive-days.open { display: block; }
.drive-day { margin-bottom: 12px; }
.drive-day-label {
    font-size: 0.82rem; font-weight: 600; color: #888;
    letter-spacing: .04em; text-transform: uppercase;
    margin-bottom: 6px; padding: 4px 0;
    border-bottom: 1px solid var(--border);
}
.drive-file-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 7px;
    background: var(--surface); border: 1px solid var(--border);
    margin-bottom: 6px;
}
.drive-file-row .df-icon { font-size: 24px; color: var(--sidebar-bg); flex-shrink: 0; }
.drive-file-row .df-name { flex: 1; font-size: 0.88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-file-row .df-note { font-size: 0.78rem; color: #aaa; font-style: italic; }
.drive-file-row .df-actions { display: flex; gap: 6px; flex-shrink: 0; }
.df-btn {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    padding: 4px 8px; cursor: pointer; font-size: 0.78rem; color: #555;
    display: flex; align-items: center; gap: 4px;
    transition: border-color .15s, color .15s;
}
.df-btn:hover { border-color: var(--sidebar-bg); color: var(--sidebar-bg); }
.df-btn .material-symbols-outlined { font-size: 16px; }

/* ── Breadcrumb (visão interna de doutor) ── */
.upload-breadcrumb {
    font-size: 0.88rem; color: #888; margin-bottom: 20px;
    display: flex; align-items: center; gap: 6px;
}
.upload-breadcrumb a { color: var(--sidebar-bg); text-decoration: none; }
.upload-breadcrumb a:hover { text-decoration: underline; }

/* ── Sem pasta configurada ── */
.drive-unconfigured {
    background: #fff8e1; border: 1px solid #ffe082;
    border-radius: 10px; padding: 28px 24px;
    display: flex; align-items: flex-start; gap: 14px;
}
.drive-unconfigured .material-symbols-outlined { color: #f59e0b; font-size: 28px; flex-shrink: 0; }
.drive-unconfigured p { margin: 0; color: #7a6000; font-size: 0.92rem; }

/* ── Modal renomear / mover ── */
.df-modal-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); z-index: 1000;
    align-items: center; justify-content: center;
}
.df-modal-backdrop.open { display: flex; }
.df-modal {
    background: var(--surface); border-radius: 12px;
    padding: 28px; width: 100%; max-width: 440px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.df-modal h3 { margin: 0 0 18px; font-size: 1rem; }
.df-modal input, .df-modal select {
    width: 100%; border: 1px solid var(--border); border-radius: 7px;
    padding: 9px 12px; font-size: 0.9rem; box-sizing: border-box;
}
.df-modal input:focus, .df-modal select:focus { outline: none; border-color: var(--sidebar-bg); }
.df-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ── Automações ─────────────────────────────────────────────────────────── */
.automation-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    min-height: calc(100vh - 140px);
}
.automation-list {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.automation-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.automation-card:hover    { border-color: var(--sidebar-bg); }
.automation-card.selected { border-color: var(--sidebar-bg); box-shadow: 0 0 0 2px rgba(26,26,46,.12); }
.automation-card-name { font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.automation-card-desc { font-size: .82rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.automation-detail {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    min-height: 300px;
}
.automation-detail-placeholder { text-align: center; color: #bbb; padding: 60px 0; font-size: .95rem; }
.automation-detail h2 { font-size: 1.1rem; margin-bottom: 6px; }
.automation-detail-desc { color: #666; font-size: .88rem; margin-bottom: 20px; }
.automation-clients-title {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: #888; margin-bottom: 12px;
}

.client-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background .12s;
    user-select: none;
}
.client-toggle-row:hover { background: #f8f9fa; }
.client-toggle-row input[type="checkbox"] {
    width: 17px; height: 17px;
    cursor: pointer;
    accent-color: var(--sidebar-bg);
    flex-shrink: 0;
}
.client-toggle-row .ct-name { flex: 1; font-size: .9rem; }
.client-toggle-row .ct-badge {
    font-size: .72rem; font-weight: 600; padding: 2px 8px;
    border-radius: 20px; background: #e6f4ea; color: #1e7e34;
}
.client-toggle-row .ct-badge.inactive { background: #f0f0f0; color: #999; }

.main-content {
    display: flex;
    flex-direction: column;
}
.table-wrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.table-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* ── Animação spin ─────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* ── Estado de carregamento ─────────────────────────────────────────────── */
.loading-state {
    text-align: center;
    padding: 60px 0;
    color: #bbb;
}
.loading-state .material-symbols-outlined {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

/* ── Automações (estados extras) ────────────────────────────────────────── */
.automation-list-empty       { color: #aaa; font-size: .9rem; padding: 16px 0; }
.automation-clients-empty    { color: #aaa; font-size: .88rem; }
.automation-placeholder-icon { font-size: 40px; display: block; margin-bottom: 12px; color: #ddd; }

/* ── Planilhas Google Sheets (doctors_update) ───────────────────────────── */
.sheet-row         { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.sheet-row-remove  { padding-bottom: 6px; }
.sheet-field-fixed { flex: 0 0 180px; min-width: 140px; }
.sheet-field-grow  { flex: 1; }

/* ── Formulário — variações ─────────────────────────────────────────────── */
.form-grid-bare { padding: 0; border: none; margin: 0; }
.mt-12          { margin-top: 12px; }
.mb-12          { margin-bottom: 12px; }

/* ── Upload ─────────────────────────────────────────────────────────────── */
.upload-section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}
.upload-hint { font-size: 0.85rem; color: #888; margin-top: 0; }
.dz-icon .material-symbols-outlined { font-size: 48px; }

/* ── Ícones utilitários ─────────────────────────────────────────────────── */
.icon-sm          { font-size: 16px; }
.icon-inline      { font-size: 18px; vertical-align: middle; }
.icon-placeholder { font-size: 48px; display: block; margin-bottom: 8px; color: #ddd; }

/* ── Texto utilitários ──────────────────────────────────────────────────── */
.text-muted    { color: #888; }
.text-light    { color: #bbb; }
.text-primary  { color: var(--sidebar-bg); }
.text-optional { font-weight: 400; color: #aaa; }

/* ── Login — mensagem de sucesso ────────────────────────────────────────── */
.login-success {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
}

/* =====================
   Utilitários
===================== */
body.no-scroll { overflow: hidden; }

/* =====================
   Mobile
===================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 100;
        width: var(--sidebar-w) !important; /* ignora .collapsed no mobile */
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sidebar.sidebar--mobile-open     { transform: translateX(0); }
    .sidebar.collapsed .text          { display: inline; } /* mostra texto mesmo colapsado */
    .mobile-hamburger                 { display: flex; }
    .form-shell                       { padding: 16px; }
    .form-grid                        { grid-template-columns: 1fr; }
    .form-field-full                  { grid-column: auto; }
    .input-action-row                 { flex-direction: column; align-items: stretch; }
    .form-actions                     { flex-direction: column-reverse; }
    .form-actions .btn                { width: 100%; text-align: center; }
}

/* =====================
   Onboarding
===================== */
.onboarding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}
.onboarding-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 200px;
}
.onboarding-progress-bar {
    height: 7px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.onboarding-progress-bar-fill {
    height: 100%;
    background: var(--sidebar-bg);
    border-radius: 4px;
    transition: width .6s ease;
}
.onboarding-progress-label {
    font-size: .75rem;
    color: #888;
    text-align: right;
}
.onboarding-subtitle {
    color: #666;
    font-size: .9rem;
    margin-bottom: 28px;
}

.onboarding-week {
    margin-bottom: 32px;
}
.onboarding-week-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.onboarding-week-badge {
    font-size: .7rem;
    padding: 2px 10px;
    border-radius: 20px;
    background: var(--sidebar-bg);
    color: #fff;
    font-weight: 600;
}
.onboarding-week.locked .onboarding-week-badge { background: #bbb; }
.onboarding-week.locked .onboarding-task-card  { opacity: .5; pointer-events: none; }

.onboarding-task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
    transition: box-shadow .15s;
}
.onboarding-task-card:hover      { box-shadow: 0 4px 12px rgba(0,0,0,.07); }
.onboarding-task-card.done       { background: #f6fef9; border-color: #a7f3d0; }
.otc-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.otc-info    { flex: 1; min-width: 0; }
.otc-name    { font-weight: 600; font-size: .93rem; color: #1a1a2e; }
.otc-done-at { font-size: .76rem; color: #888; margin-top: 2px; }
.otc-action  { flex-shrink: 0; }
.otc-badge-done {
    font-size: .73rem;
    font-weight: 700;
    color: #059669;
    background: #d1fae5;
    border-radius: 20px;
    padding: 3px 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.onboarding-flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: .9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.onboarding-flash.success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.onboarding-flash.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Arquétipos quiz */
.arq-progress-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 24px; }
.arq-progress-bar-fill { height: 100%; background: var(--sidebar-bg); border-radius: 3px; transition: width .3s ease; }
.arq-question-block { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.arq-question-text  { font-size: .93rem; font-weight: 500; color: #1a1a2e; margin-bottom: 12px; }
.arq-scale {
    display: flex;
    gap: 8px;
    align-items: center;
}
.arq-scale label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    color: #888;
    cursor: pointer;
    flex: 1;
    text-align: center;
}
.arq-scale input[type="radio"] { accent-color: var(--sidebar-bg); width: 18px; height: 18px; cursor: pointer; }
.arq-scale-labels { display: flex; justify-content: space-between; font-size: .72rem; color: #aaa; margin-top: 6px; }
.arq-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.arq-counter { font-size: .82rem; color: #888; }

/* NPS */
.nps-block { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; margin-bottom: 20px; }
.nps-block-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #888; margin-bottom: 14px; }
.nps-score-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.nps-score-btn {
    width: 44px; height: 44px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    transition: all .15s;
    color: var(--text);
}
.nps-score-btn:hover  { border-color: var(--sidebar-bg); color: var(--sidebar-bg); }
.nps-score-btn.active { background: var(--sidebar-bg); border-color: var(--sidebar-bg); color: #fff; }
.nps-choices { display: flex; flex-direction: column; gap: 8px; }
.nps-choice-label { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 10px; border-radius: 7px; transition: background .12s; font-size: .9rem; }
.nps-choice-label:hover { background: #f5f5f5; }
.nps-choice-label input { width: 17px; height: 17px; accent-color: var(--sidebar-bg); cursor: pointer; }
.nps-likert-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.nps-likert-row:last-child { border-bottom: none; }
.nps-likert-text { flex: 1; font-size: .88rem; }
.nps-likert-scale { display: flex; gap: 10px; }
.nps-likert-scale label { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .72rem; color: #aaa; cursor: pointer; }
.nps-likert-scale input { accent-color: var(--sidebar-bg); width: 16px; height: 16px; cursor: pointer; }
.nps-textarea { width: 100%; min-height: 100px; resize: vertical; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: inherit; font-size: .9rem; color: var(--text); outline: none; transition: border-color .15s; }
.nps-textarea:focus { border-color: var(--sidebar-bg); }

/* =====================
   Admin Panel
===================== */
.admin-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    padding: 28px 32px;
    margin-bottom: 32px;
}

.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-panel-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.admin-tabs {
    display: flex;
    gap: 6px;
    background: #F3F4F6;
    padding: 4px;
    border-radius: 10px;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: .875rem;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all .18s;
}

.admin-tab .material-symbols-outlined { font-size: 1.1rem; }
.admin-tab:hover  { background: #E5E7EB; color: #374151; }
.admin-tab.active { background: #fff; color: #1E3A8A; box-shadow: 0 1px 4px rgba(0,0,0,.12); }

.admin-tab-panel        { display: none; }
.admin-tab-panel.active { display: block; }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.panel-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.panel-toolbar input[type="search"] {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: .875rem;
    outline: none;
    transition: border-color .15s;
}
.panel-toolbar input[type="search"]:focus { border-color: #3B82F6; }
.panel-toolbar select {
    padding: 8px 11px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: .875rem;
}

/* ── Admin table ─────────────────────────────────────────────────────────── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.admin-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #6B7280;
    border-bottom: 1px solid #E5E7EB;
}

.admin-table td {
    padding: 11px 12px;
    color: #374151;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #F9FAFB; }
.admin-table .row-actions { display: flex; gap: 6px; }

/* ── Dept cards ──────────────────────────────────────────────────────────── */
#deptsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.dept-card {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .18s;
}

.dept-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.dept-card-color-bar { height: 6px; width: 100%; }

.dept-card-body { padding: 16px; }
.dept-card-name { font-weight: 700; font-size: 1rem; color: #111827; margin-bottom: 4px; }
.dept-card-meta { font-size: .8rem; color: #6B7280; margin-bottom: 14px; min-height: 18px; }
.dept-card-actions { display: flex; gap: 6px; }

/* ── Color wheel ─────────────────────────────────────────────────────────── */
.color-wheel {
    display: grid;
    grid-template-columns: repeat(8, 32px);
    gap: 8px;
    margin: 10px 0;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .15s, outline .15s;
    outline: 3px solid transparent;
    outline-offset: 2px;
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { outline: 3px solid #111827; }

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.adm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.adm-overlay.open { display: flex; }

.adm-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    padding: 28px 32px;
    position: relative;
}

.adm-modal-lg { max-width: 720px; }

.adm-modal h3 {
    margin: 0 0 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.adm-modal-close {
    position: absolute;
    top: 16px; right: 18px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6B7280;
    font-size: 1.4rem;
    line-height: 1;
}

.adm-modal-close:hover { color: #111827; }

/* ── Form helpers ────────────────────────────────────────────────────────── */
.adm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

@media (max-width: 480px) { .adm-form-row { grid-template-columns: 1fr; } }
.adm-form-row.full { grid-template-columns: 1fr; }

.adm-field label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.adm-field input,
.adm-field select {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: .875rem;
    color: #111827;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}

.adm-field input:focus,
.adm-field select:focus { border-color: #3B82F6; }

.adm-field .input-row { display: flex; gap: 6px; }
.adm-field .input-row input { flex: 1; }

.adm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #F3F4F6;
}

/* ── Dept manage tabs ────────────────────────────────────────────────────── */
.dept-modal-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #E5E7EB;
    margin-bottom: 18px;
}

.dept-modal-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: .875rem;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    transition: color .15s;
}

.dept-modal-tab:hover { color: #374151; }
.dept-modal-tab.active { color: #1E3A8A; border-bottom-color: #1E3A8A; }

.dept-modal-panel        { display: none; }
.dept-modal-panel.active { display: block; }

/* ── Member row ──────────────────────────────────────────────────────────── */
.member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
}
.member-row:last-child { border-bottom: none; }

.member-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
    flex-shrink: 0;
}

.member-info { flex: 1; min-width: 0; }
.member-name { font-size: .875rem; font-weight: 600; color: #111827; }
.member-email { font-size: .75rem; color: #6B7280; }
.member-actions { display: flex; gap: 5px; align-items: center; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge-leader {
    font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    background: #FEF3C7; color: #92400E;
    padding: 2px 7px; border-radius: 20px; border: 1px solid #F59E0B;
}

.badge-active   { background: #D1FAE5; color: #065F46; padding: 2px 8px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-inactive { background: #F3F4F6; color: #6B7280;  padding: 2px 8px; border-radius: 20px; font-size: .75rem; font-weight: 600; }

/* ── Permission list ─────────────────────────────────────────────────────── */
.perm-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 4px 0;
}

.perm-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 14px;
    transition: background .12s;
    cursor: pointer;
}

.perm-item:hover { background: #F9FAFB; }
.perm-item input[type="checkbox"] { margin-top: 3px; cursor: pointer; flex-shrink: 0; }
.perm-item-key  { font-size: .85rem; font-weight: 600; color: #111827; font-family: monospace; }
.perm-item-desc { font-size: .75rem; color: #6B7280; }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.text-muted   { color: #9CA3AF; font-size: .875rem; }
.empty-state  { text-align: center; padding: 32px 0; color: #9CA3AF; font-size: .9rem; }
.mt-4 { margin-top: 16px; }
.nps-score-labels { display: flex; justify-content: space-between; font-size: .72rem; color: #aaa; margin-top: 4px; }
