/* =============================================
   IMAGOV Admin Theme
   ============================================= */
:root {
    --primary: #1a3a5c;
    --primary-light: #2c6fad;
    --accent: #00b4d8;
    --accent2: #0077b6;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

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

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0d2137 0%, #1a3a5c 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0,0,0,.25);
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-decoration: none;
}

.sidebar-brand .brand-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    color: white;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .5px;
}

.sidebar-brand .brand-sub {
    color: rgba(255,255,255,.45);
    font-size: 10px;
    display: block;
    margin-top: -2px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section-label {
    color: rgba(255,255,255,.35);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 12px 10px 6px;
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
    margin-bottom: 3px;
}

.nav-item-link:hover {
    background: rgba(255,255,255,.08);
    color: white;
}

.nav-item-link.active {
    background: linear-gradient(135deg, rgba(0,180,216,.25), rgba(0,119,182,.25));
    color: #7dd3f8;
    border: 1px solid rgba(0,180,216,.3);
}

.nav-item-link .nav-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,.07);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-item-link.active .nav-icon {
    background: rgba(0,180,216,.25);
}

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.35);
    font-size: 11px;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0; z-index: 50;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.topbar-spacer { flex: 1; }

.topbar-badge {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 6px;
}

.page-body {
    flex: 1;
    padding: 28px;
}

/* ---- CARDS ---- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.card-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

.card-header-actions { margin-left: auto; }

.card-body { padding: 20px 22px; }

/* ---- STAT CARDS ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.09);
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.blue   { background: #dbeafe; }
.stat-icon.green  { background: #d1fae5; }
.stat-icon.orange { background: #fef3c7; }
.stat-icon.purple { background: #ede9fe; }

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ---- FILTER BAR ---- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 18px 22px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.filter-group input[type="date"],
.filter-group input[type="text"],
.filter-group input[type="search"],
.filter-group select {
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    min-width: 160px;
    font-family: inherit;
}

.filter-group select {
    padding: 0 36px 0 12px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 3px rgba(44,111,173,.10);
}

.filter-group select:hover {
    border-color: var(--primary-light);
}

.btn {
    height: 38px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all .2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-light); }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #059669; }

.btn-outline {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--border);
}
.btn-outline:hover { background: var(--bg); }

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

/* ---- TABLE ---- */
.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    background: var(--primary);
    color: white;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

.data-table thead th:first-child { border-radius: 8px 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 8px 0 0; }

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.data-table tbody tr:hover { background: #f8fafc; }

.data-table tbody td {
    padding: 11px 14px;
    color: var(--text);
    vertical-align: middle;
}

.data-table tbody tr:last-child td:first-child { border-radius: 0 0 0 8px; }
.data-table tbody tr:last-child td:last-child  { border-radius: 0 0 8px 0; }

/* ---- BADGE ---- */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-orange { background: #fef3c7; color: #92400e; }

/* ---- CHART BARS ---- */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 140px;
    padding: 10px 0;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    height: 100%;
    justify-content: flex-end;
}

.bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--accent), var(--accent2));
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    transition: height .5s ease;
}

.bar-label {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

.bar-value {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
}

/* ---- DEPT BARS ---- */
.dept-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dept-bar-label {
    width: 130px;
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.dept-bar-track {
    flex: 1;
    height: 10px;
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
}

.dept-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent2), var(--accent));
    border-radius: 999px;
    transition: width .6s ease;
}

.dept-bar-count {
    width: 36px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
    opacity: .35;
}

.empty-state p { font-size: 14px; }

/* ---- LOADING ---- */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    width: 22px; height: 22px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- PAGE HEADER ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.page-header-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* =============================================
   COLABORADORES & FALTOSOS — v1.1
   ============================================= */

/* Stat icon teal */
.stat-icon.teal {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
}

/* Shortcut cards */
.shortcut-card {
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.shortcut-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,.10);
}
.shortcut-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}
.shortcut-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}
.shortcut-arrow {
    margin-left: auto;
    font-size: 20px;
    color: var(--text-muted);
}
.shortcut-danger:hover {
    border-left: 3px solid var(--danger);
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table thead th {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}
.data-table tbody tr:hover {
    background: rgba(0,180,216,.04);
}
.data-table tbody td {
    padding: 10px 14px;
    vertical-align: middle;
}

/* Department badge */
.dept-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(44,111,173,.12);
    color: var(--primary-light);
    letter-spacing: .4px;
}
.dept-badge-danger {
    background: rgba(239,68,68,.12);
    color: var(--danger);
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
}
.status-presente {
    background: rgba(16,185,129,.12);
    color: var(--success);
}
.status-ausente {
    background: rgba(239,68,68,.12);
    color: var(--danger);
}

/* Icon action buttons */
.btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background .12s, border-color .12s;
    line-height: 1;
}
.btn-icon:hover { background: var(--bg); }
.btn-icon.btn-edit:hover { border-color: var(--accent); }
.btn-icon.btn-danger:hover { border-color: var(--danger); background: rgba(239,68,68,.06); }

/* btn-danger */
.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}
.btn-danger:hover { opacity: .88; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}
.modal-box {
    background: var(--card-bg);
    border-radius: 14px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
}
.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 6px;
    transition: background .12s;
}
.modal-close:hover { background: var(--bg); }
.modal-body {
    padding: 24px;
    flex: 1;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form grid inside modal */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.form-group input,
.form-group select {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    font-family: inherit;
    height: 42px;
}
.form-group select {
    padding: 9px 36px 9px 12px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}
.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(0,180,216,.10);
}
.form-group select:hover {
    border-color: var(--accent);
}

/* Alert error inside form */
.alert-error {
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(239,68,68,.10);
    border: 1px solid rgba(239,68,68,.3);
    border-radius: 8px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
}

/* Faltosos count badge */
.faltosos-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(239,68,68,.12);
    border: 1.5px solid rgba(239,68,68,.3);
    border-radius: 20px;
    color: var(--danger);
    font-weight: 700;
    font-size: 14px;
}

/* =============================================
   SELECT WRAPPER — seta customizada universal
   ============================================= */
.select-wrapper {
    position: relative;
    display: inline-block;
}
.select-wrapper::after {
    content: '';
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-muted);
    pointer-events: none;
    transition: border-top-color .15s;
}
.select-wrapper:hover::after {
    border-top-color: var(--primary-light);
}
.select-wrapper select {
    width: 100%;
    padding-right: 34px;
    appearance: none;
    -webkit-appearance: none;
    background-image: none !important; /* usa o ::after pseudo-element */
    cursor: pointer;
}
/* Quando dentro de filter-group herda height do pai */
.filter-group .select-wrapper {
    display: block;
}
.filter-group .select-wrapper select {
    width: 100%;
    min-width: 180px;
}

/* =============================================
   FALTOSOS — dept summary strip
   ============================================= */
.faltosos-dept-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.faltosos-dept-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 14px 20px;
    background: white;
    border: 1.5px solid rgba(239,68,68,.25);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(239,68,68,.08);
    gap: 2px;
}
.faltosos-dept-count {
    font-size: 28px;
    font-weight: 800;
    color: var(--danger);
    line-height: 1;
}
.faltosos-dept-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: .5px;
    margin-top: 4px;
}
.faltosos-dept-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Faltoso table row highlight */
.faltoso-row {
    background: rgba(239,68,68,.03);
    border-left: 3px solid transparent;
    transition: background .12s, border-left-color .12s;
}
.faltoso-row:hover {
    background: rgba(239,68,68,.07);
    border-left-color: var(--danger);
}

/* Avatar initials helper */
.avatar-initials {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 15px;
    flex-shrink: 0;
}
.avatar-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}
.avatar-default {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
}

/* =============================================
   TOPBAR — user badge + logout
   ============================================= */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 12px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}
.topbar-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(26,58,92,.25);
}
.topbar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .2px;
}
.topbar-logout {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 15px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    line-height: 1;
    margin-left: 2px;
}
.topbar-logout:hover {
    background: rgba(239,68,68,.08);
    color: var(--danger);
    border-color: rgba(239,68,68,.35);
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a1628 0%, #0d2137 40%, #1a3a5c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* Animated decorative shapes */
.login-shape {
    position: absolute;
    border-radius: 50%;
    opacity: .06;
    animation: floatShape 8s ease-in-out infinite;
}
.login-shape-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--accent), transparent);
    top: -150px; right: -100px;
    animation-delay: 0s;
}
.login-shape-2 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, var(--primary-light), transparent);
    bottom: -100px; left: -80px;
    animation-delay: 3s;
}
.login-shape-3 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, var(--accent2), transparent);
    top: 50%; left: 15%;
    animation-delay: 5s;
}
@keyframes floatShape {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-30px) scale(1.05); }
}

/* Card */
.login-card {
    background: rgba(255,255,255,.97);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 40px 40px 32px;
    box-shadow: 0 30px 80px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.05);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
    animation: slideUp .4s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Brand */
.login-brand {
    text-align: center;
    margin-bottom: 28px;
}
.login-brand-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(0,180,216,.3));
}
.login-brand-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.login-brand-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.login-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin-bottom: 28px;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.login-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.login-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
    transition: color .15s;
}
.login-form-group.focused .login-label {
    color: var(--primary-light);
}
.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.login-input-icon {
    position: absolute;
    left: 13px;
    font-size: 15px;
    pointer-events: none;
    z-index: 1;
}
.login-input {
    width: 100%;
    height: 46px;
    padding: 0 42px 0 40px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    font-family: inherit;
}
.login-input:focus {
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 3px rgba(44,111,173,.12);
}
.login-input.input-error {
    border-color: var(--danger);
    background: rgba(239,68,68,.03);
}
.login-input.input-error:focus {
    box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}
.login-eye {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 6px;
    transition: background .12s;
    line-height: 1;
}
.login-eye:hover { background: var(--bg); }

/* Error message */
.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(239,68,68,.08);
    border: 1px solid rgba(239,68,68,.25);
    border-radius: 9px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    animation: shake .35s ease both;
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* Login button */
.login-btn {
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    transition: opacity .15s, transform .15s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(26,58,92,.3);
    letter-spacing: .3px;
}
.login-btn:hover:not(:disabled) {
    opacity: .92;
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(26,58,92,.4);
}
.login-btn:active:not(:disabled) {
    transform: translateY(0);
}
.login-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}
.login-btn-arrow {
    font-size: 18px;
    transition: transform .2s;
}
.login-btn:hover .login-btn-arrow {
    transform: translateX(4px);
}

/* Spinner inside button */
.login-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: .5px;
}

/* =============================================
   DOWNLOAD BUTTON & INLINE SPINNER
   ============================================= */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    height: 38px;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .3px;
    transition: opacity .15s, transform .15s, box-shadow .15s;
    box-shadow: 0 3px 10px rgba(13,148,136,.3);
    white-space: nowrap;
}
.btn-download:hover:not(:disabled) {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(13,148,136,.4);
}
.btn-download:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

/* ── BLAZOR ERROR UI ────────────────────────────────────────────────────── */
/* Garante que a barra de erro aparece sempre por cima da sidebar e topbar  */
#blazor-error-ui {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;          /* muito acima da sidebar (z-index:100) */
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    color: #fff;
    padding: 14px 24px;
    display: none;           /* Blazor mostra via JS quando necessário */
    align-items: center;
    justify-content: center; /* centra o conteúdo horizontalmente na barra */
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 -4px 20px rgba(0,0,0,.35);
    border-top: 2px solid #ef4444;
}
#blazor-error-ui.blazor-error-ui-visible,
#blazor-error-ui[style*="display: flex"],
#blazor-error-ui[style*="display:flex"] {
    display: flex !important;
}
#blazor-error-ui .reload {
    color: #fde68a;
    font-weight: 700;
    text-decoration: underline;
    margin-left: 8px;
}
#blazor-error-ui .reload:hover { color: #fbbf24; }
#blazor-error-ui .dismiss {
    position: absolute;  /* não afecta o centramento dos outros elementos */
    right: 20px;
    cursor: pointer;
    font-size: 16px;
    opacity: .8;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background .15s;
}
#blazor-error-ui .dismiss:hover { background: rgba(255,255,255,.15); opacity: 1; }

/* Label hint (texto pequeno ao lado do label) */
.label-hint {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
    opacity: .8;
}
