/* ============================================================
   Sistema de Feedback Interno — DNA REC
   Design: Dark Glassmorphism + Premium Aesthetics
   ============================================================ */

/* ===== VARIABLES ===== */
:root {
    --bg-dark: #0a0e1a;
    --bg-surface: #111827;
    --glass-bg: #111827;
    --glass-border: rgba(148, 163, 184, 0.08);
    --glass-bg-hover: #1a2236;
    --bg-input: rgba(255, 255, 255, 0.04);
    --border: rgba(148, 163, 184, 0.1);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    --info: #06b6d4;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.15);
    --radius: 4px;
    --radius-sm: 3px;
    --radius-xs: 2px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: all 0.2s ease;
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(37, 99, 235, 0.04) 0%, transparent 50%);
}

/* ===== LOGIN ===== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: #0a0e1a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Subtle grid behind login */
.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Top ambient glow */
.login-overlay::after {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(59, 130, 246, 0.07) 0%, transparent 65%);
    pointer-events: none;
}

.login-overlay.hidden {
    display: none;
}

.login-box {
    position: relative;
    background: #111827;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 4px;
    padding: 2.5rem 2rem 2rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: loginReveal 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 1;
}

/* Animated scanner line */
.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scanLine 3s ease-in-out infinite;
}

@keyframes scanLine {
    0%, 100% { opacity: 0.3; transform: scaleX(0.3); }
    50% { opacity: 1; transform: scaleX(1); }
}

@keyframes loginReveal {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo-wrap {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
}

.login-logo {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
    50% { box-shadow: 0 0 20px -4px rgba(59, 130, 246, 0.2); }
}

.login-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 1.75rem;
    letter-spacing: 0.02em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: fieldsReveal 0.5s ease 0.15s both;
}

@keyframes fieldsReveal {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-field {
    position: relative;
}

.login-field .field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    z-index: 1;
    transition: color 0.2s ease;
}

.login-field:focus-within .field-icon {
    color: var(--primary);
}

.login-field input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-left: 2px solid rgba(148, 163, 184, 0.1);
    border-radius: 3px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.login-field input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.3);
    border-left-color: var(--primary);
    background: rgba(59, 130, 246, 0.03);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.06);
}

.login-field input::placeholder {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: 3px;
    background: var(--primary);
    color: white;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    margin-top: 0.25rem;
}

.login-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.08) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.login-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.login-btn:hover::after {
    transform: translateX(100%);
}

.login-btn:active {
    transform: scale(0.98);
    box-shadow: none;
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.login-btn:disabled::after { display: none; }

/* Hidden button state + reveal animation */
.login-btn-hidden {
    max-height: 0;
    padding: 0 0.875rem;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease, margin 0.4s ease;
}

.login-btn-reveal {
    max-height: 56px;
    padding: 0.875rem;
    margin-top: 0.25rem;
    opacity: 1;
    pointer-events: auto;
}

/* Subtle loading indicator */
.login-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.login-loading.active {
    display: flex;
    animation: fieldsReveal 0.3s ease both;
}

.login-loading-bar {
    width: 100%;
    height: 2px;
    background: rgba(148, 163, 184, 0.08);
    border-radius: 1px;
    overflow: hidden;
    position: relative;
}

.login-loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: var(--primary);
    border-radius: 1px;
    animation: loadingSlide 1.5s ease-in-out infinite;
}

@keyframes loadingSlide {
    0% { left: -40%; }
    100% { left: 100%; }
}

.login-loading-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.login-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--danger);
    padding: 0.75rem;
    border-radius: 3px;
    font-size: 0.8rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
    animation: shakeError 0.3s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.login-error.show {
    display: flex;
}

.login-hint {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.06);
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.85rem;
    z-index: 1;
    transition: color 0.15s ease;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.login-senha-field input {
    padding-right: 2.75rem;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-hint i {
    color: var(--primary);
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* ===== HEADER ===== */
.header {
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.875rem 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1600px;
    margin: 0 auto;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 3px;
}

.logo-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.session-timer {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.session-timer i {
    font-size: 0.65rem;
    opacity: 0.7;
}

.session-timer.warning {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
    animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@media (max-width: 480px) {
    .session-timer { display: none; }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 3px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notif-btn {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.btn-icon {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.tab-nav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0.5rem 1.5rem 0.25rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 52px;
    z-index: 99;
}

.tab-btn {
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-badge {
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-content {
    display: none;
    animation: fadeUp 0.4s ease;
}

.tab-content.active {
    display: block;
}

.main-app {
    display: none;
    position: relative;
    z-index: 1;
}

.main-app.visible {
    display: block;
}

.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ===== NOTIFICATIONS PANEL ===== */
.notif-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.notif-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.notif-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--glass-border);
    z-index: 200;
    transition: right 0.35s ease;
    overflow-y: auto;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
}

.notif-panel.open {
    right: 0;
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.notif-panel-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notif-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notif-close-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.notif-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.75rem;
    cursor: pointer;
}

.notif-list {
    padding: 0.5rem;
}

.notif-item {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-item.unread {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.15);
}

.notif-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notif-item-msg {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notif-item-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.empty-notif {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-notif i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    opacity: 0.4;
}

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.1rem;
}

.stat-total .stat-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
}

.stat-pendente .stat-icon {
    background: var(--warning-glow);
    color: var(--warning);
}

.stat-aprovado .stat-icon {
    background: var(--success-glow);
    color: var(--success);
}

.stat-recusado .stat-icon {
    background: var(--danger-glow);
    color: var(--danger);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ===== CHARTS ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.chart-full {
    grid-column: 1 / -1;
}

.chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.chart-title i {
    color: var(--primary);
}

/* ===== TOP LIST ===== */
.top-list {
    max-height: 400px;
    overflow-y: auto;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.top-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.top-rank {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-muted);
    min-width: 28px;
    text-align: center;
}

.top-rank.gold {
    color: #fbbf24;
}

.top-rank.silver {
    color: #94a3b8;
}

.top-rank.bronze {
    color: #d97706;
}

.top-avatar {
    width: 38px;
    height: 38px;
    border-radius: 3px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
    flex-shrink: 0;
}

.top-info {
    flex: 1;
    min-width: 0;
}

.top-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.top-badges {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mini-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.mini-badge.pos {
    background: var(--success-glow);
    color: var(--success);
}

.mini-badge.neg {
    background: var(--danger-glow);
    color: var(--danger);
}

/* ===== FORMS ===== */
.form-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1rem;
}

.form-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-card-title i {
    color: var(--primary);
}

.form-section {
    margin-bottom: 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.field-input,
.field-select,
.field-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.field-input::placeholder,
.field-textarea::placeholder {
    color: var(--text-muted);
}

.field-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.field-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* ===== CUSTOM DROPDOWN ===== */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-trigger {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    text-align: left;
}

.dropdown-trigger:hover {
    border-color: var(--primary);
}

.dropdown-trigger:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.custom-dropdown.selected .dropdown-trigger {
    border-color: var(--primary);
}

.dropdown-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.25s ease;
    margin-left: 0.5rem;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1a2236;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.06);
    z-index: 100;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 0.35rem;
    max-height: 280px;
    overflow-y: auto;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-primary);
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.08);
    border-left-color: var(--primary);
}

.dropdown-item.active {
    background: rgba(59, 130, 246, 0.12);
    border-left-color: var(--primary);
    font-weight: 600;
}

.dropdown-icon {
    font-size: 1.1rem;
    width: 1.6rem;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== TESTEMUNHAS CHIPS ===== */
.testemunhas-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 0;
}

.testemunha-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.testemunha-chip i.fa-user {
    color: #06b6d4;
    font-size: 0.65rem;
}

.testemunha-chip strong {
    color: #06b6d4;
    font-weight: 700;
}

.testemunha-chip:hover {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.testemunha-chip-x {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.15rem;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.testemunha-chip-x:hover {
    color: var(--danger);
}

.field-textarea {
    resize: vertical;
    min-height: 100px;
}

.field-color {
    height: 44px;
    padding: 4px;
    cursor: pointer;
}

.search-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.search-row .field-input-wrapper {
    flex: 1;
    position: relative;
}

.search-row .field-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-row .field-input-wrapper .field-input {
    padding-left: 2.75rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 6px 20px var(--success-glow);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 6px 20px var(--danger-glow);
}

.btn-ghost {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

/* ===== NATUREZA TOGGLE ===== */
.natureza-toggle {
    display: flex;
    gap: 1rem;
}

.natureza-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.natureza-btn:hover {
    transform: translateY(-2px);
}

.natureza-positivo {
    border-color: rgba(34, 197, 94, 0.25);
}

.natureza-positivo:hover {
    border-color: var(--success);
    color: var(--success);
    background: rgba(34, 197, 94, 0.08);
}

.natureza-positivo.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border-color: var(--success);
    color: var(--success);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.25), inset 0 0 20px rgba(34, 197, 94, 0.05);
}

.natureza-negativo {
    border-color: rgba(239, 68, 68, 0.25);
}

.natureza-negativo:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.natureza-negativo.active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.25), inset 0 0 20px rgba(239, 68, 68, 0.05);
}

.badge-nat-positivo {
    background: var(--success-glow);
    color: var(--success);
}

.badge-nat-negativo {
    background: var(--danger-glow);
    color: var(--danger);
}

/* ===== EMPLOYEE PROFILE CARD ===== */
.employee-profile-card {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: fadeUp 0.3s ease;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-tag {
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===== FILTERS ===== */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-select {
    padding: 0.85rem 2.5rem 0.85rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.filter-select option {
    background: var(--bg-surface);
}

.record-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.section-header {
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 i {
    color: var(--primary);
}

/* ===== RECORDS LIST ===== */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.record-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.record-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.record-title {
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
}

.record-badges {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-elogio {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.badge-reconhecimento {
    background: rgba(6, 182, 212, 0.12);
    color: var(--info);
}

.badge-orientacao {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
}

.badge-advertencia_verbal {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.badge-advertencia_escrita {
    background: rgba(249, 115, 22, 0.12);
    color: #f97316;
}

.badge-suspensao {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.badge-outro {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent);
}

.badge-pendente {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-weight: 700;
}

.badge-aprovado {
    background: var(--success-glow);
    color: var(--success);
}

.badge-recusado {
    background: var(--danger-glow);
    color: var(--danger);
}

.badge-positivo {
    background: var(--success-glow);
    color: var(--success);
}

.badge-neutro {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
}

.badge-leve {
    background: rgba(250, 204, 21, 0.12);
    color: #facc15;
}

.badge-moderado {
    background: rgba(249, 115, 22, 0.12);
    color: #f97316;
}

.badge-grave {
    background: var(--danger-glow);
    color: var(--danger);
}

.badge-gravissimo {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}

.record-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.record-avatar {
    width: 40px;
    height: 40px;
    border-radius: 3px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
    flex-shrink: 0;
}

.record-info {
    flex: 1;
    min-width: 0;
}

.record-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.record-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.record-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.severity-bar {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.75rem;
}

.severity-positivo {
    background: linear-gradient(90deg, var(--success), #4ade80);
}

.severity-neutro {
    background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}

.severity-leve {
    background: linear-gradient(90deg, #facc15, #fde047);
}

.severity-moderado {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.severity-grave {
    background: linear-gradient(90deg, var(--danger), #f87171);
}

.severity-gravissimo {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

/* ===== TABLE ===== */
.table-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 1rem;
}

.table-title {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-title i {
    color: var(--primary);
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

/* ===== ADMIN TABS ===== */
.admin-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
}

.admin-tab-btn {
    padding: 0.65rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.admin-tab-btn:hover {
    color: var(--text-primary);
}

.admin-tab-btn.active {
    background: var(--primary);
    color: white;
}

.admin-tab-content {
    display: none;
    animation: fadeUp 0.3s ease;
}

.admin-tab-content.active {
    display: block;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: fadeUp 0.3s ease;
}

.modal-lg {
    max-width: 800px;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-avaliar-section {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-top: 0.5rem;
}

.modal-avaliar-section h3 {
    color: var(--text-primary);
}

.modal-avaliar-section .field-textarea {
    margin-top: 0.5rem;
}

.modal-avaliar-section .modal-actions {
    margin-top: 0.75rem;
}

.detail-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 100px;
}

.detail-value {
    font-size: 0.9rem;
    flex: 1;
}

.detail-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1rem 0;
}

/* ===== DESCRIÇÃO CARD ===== */
.descricao-card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--desc-accent, var(--primary));
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 1rem;
    overflow: hidden;
}

.descricao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 0.5rem;
    flex-wrap: wrap;
}

.descricao-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--desc-accent, var(--primary));
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.descricao-title i {
    font-size: 0.8rem;
}

.descricao-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.descricao-meta span {
    background: rgba(255, 255, 255, 0.04);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    white-space: nowrap;
}

.descricao-body {
    padding: 1.2rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.85;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.descricao-footer {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.68rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.descricao-footer span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.descricao-footer i {
    font-size: 0.6rem;
    opacity: 0.6;
}

/* ===== SECTION TITLE ===== */
.detail-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

/* ===== AUTHOR CARD ===== */
.author-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}

.author-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 3px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.author-info {
    flex: 1;
    min-width: 0;
}

.author-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.author-role i {
    font-size: 0.65rem;
    margin-right: 0.25rem;
    opacity: 0.7;
}

.author-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.author-date i {
    font-size: 0.65rem;
    opacity: 0.6;
}

/* ===== AVALIAÇÃO CARDS ===== */
.avaliacao-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 0.75rem;
}

.avaliacao-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.65rem;
    gap: 0.5rem;
}

.avaliacao-author-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
}

.avaliacao-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 3px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
}

.avaliacao-autor {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.avaliacao-role {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.avaliacao-role i {
    font-size: 0.6rem;
    margin-right: 0.2rem;
    opacity: 0.7;
}

.avaliacao-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.avaliacao-timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.avaliacao-timestamp i {
    font-size: 0.6rem;
    opacity: 0.6;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.85rem 1.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 9999;
    transition: bottom 0.4s ease, opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    visibility: hidden;
    opacity: 0;
}

.toast.show {
    bottom: 2rem;
    visibility: visible;
    opacity: 1;
}

.toast.success {
    background: var(--success);
    color: white;
}

.toast.error {
    background: var(--danger);
    color: white;
}

.toast.warning {
    background: var(--warning);
    color: white;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.85rem;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 2rem auto;
}

/* ===== HIERARCHY CARDS ===== */
.hier-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.hier-main-title {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.hier-main-title i {
    color: var(--primary);
}

.hier-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hier-search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hier-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1rem;
}

.hier-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: var(--transition);
    animation: fadeUp 0.3s ease;
}

.hier-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.hier-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.hier-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hier-card-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hier-nivel-pill {
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.hier-card-config {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.hier-cfg {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 80px;
}

.hier-cfg label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hier-cfg-select {
    padding: 0.4rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
}

.hier-cfg-select:focus {
    outline: none;
    border-color: var(--primary);
}

.hier-cfg-select option {
    background: var(--bg-surface);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--success);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(18px);
    background: white;
}

/* Subordinates Section */
.hier-subs {
    border-top: 1px solid var(--glass-border);
    padding-top: 0.85rem;
}

.hier-subs-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.hier-subs-title i {
    color: var(--primary);
    font-size: 0.7rem;
}

.hier-subs-count {
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.hier-subs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.sub-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
}

.sub-chip i.fa-user {
    color: var(--primary);
    font-size: 0.6rem;
}

.sub-chip-x {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    transition: var(--transition);
    margin-left: 0.15rem;
}

.sub-chip-x:hover {
    color: var(--danger);
}

.sub-chip:hover {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.no-subs-msg {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-style: italic;
}

.no-subs-msg i {
    font-size: 0.7rem;
}

.hier-add-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.hier-add-select {
    flex: 1;
    padding: 0.45rem 0.7rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
}

.hier-add-select:focus {
    outline: none;
    border-color: var(--primary);
}

.hier-add-select option {
    background: var(--bg-surface);
}

/* Individual Subordinates */
.hier-individuais {
    border-top: 1px solid var(--glass-border);
    padding-top: 0.85rem;
    margin-top: 0.15rem;
}

.sub-chip-ind {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}

.sub-chip-ind i.fa-id-badge {
    color: #f59e0b;
    font-size: 0.65rem;
}

.sub-chip-ind strong {
    font-weight: 700;
    color: #f59e0b;
    font-size: 0.7rem;
}

.sub-chip-ind:hover {
    border-color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.ind-funcao-tag {
    font-size: 0.6rem;
    color: var(--text-muted);
    padding: 0.1rem 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-left: 0.2rem;
    font-style: italic;
}

.hier-ind-input {
    flex: 1;
    padding: 0.45rem 0.7rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.78rem;
    transition: var(--transition);
    max-width: 140px;
}

.hier-ind-input:focus {
    outline: none;
    border-color: #f59e0b;
}

.hier-ind-input::placeholder {
    color: var(--text-muted);
}

.hier-subs-count-ind {
    background: #f59e0b !important;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   RESPONSIVE — Mobile-First Optimization
   Touch targets: min 48px | Thumb zone CTAs | Stacked layouts
   Breakpoints: 1024px → 768px → 480px → 360px
   ============================================================ */

/* ----- TABLET: ≤1024px ----- */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid-7 {
        grid-template-columns: repeat(4, 1fr);
    }

    .charts-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

/* ----- MOBILE: ≤768px ----- */
@media (max-width: 768px) {

    /* --- HEADER --- */
    .header {
        padding: 0.625rem 1rem;
    }

    .header-content {
        flex-wrap: wrap;
    }

    .logo-img {
        width: 32px;
        height: 32px;
    }

    .logo-title {
        font-size: 1rem;
    }

    .logo-subtitle {
        font-size: 0.6rem;
    }

    .user-details {
        display: none;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.65rem;
    }

    .session-timer {
        display: none !important;
    }

    /* --- TAB NAV → Bottom Bar on Mobile --- */
    .tab-nav {
        position: fixed;
        bottom: 0;
        top: auto; /* override desktop sticky top */
        left: 0;
        right: 0;
        z-index: 150;
        background: var(--bg-surface);
        border-top: 1px solid var(--glass-border);
        border-bottom: none;
        margin: 0;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        gap: 0;
        max-width: 100%;
        display: flex;
        justify-content: space-around;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        scrollbar-width: none;
        backdrop-filter: blur(20px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    }

    .tab-nav::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        flex: 1;
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.5rem 0.25rem;
        font-size: 0.6rem;
        font-weight: 500;
        min-height: 52px;
        min-width: 0;
        border-radius: 0;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tab-btn i {
        font-size: 1.1rem;
        display: block;
    }

    .tab-btn.active {
        border-radius: 0;
        background: transparent;
        color: var(--primary);
        border-top: 2px solid var(--primary);
    }

    .tab-badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 16px);
        transform: translateX(100%);
        font-size: 0.5rem;
        min-width: 15px;
        height: 15px;
    }

    /* Main content padding for bottom nav */
    .main-content {
        padding: 1rem;
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }

    /* --- STATS GRID --- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stats-grid-7 {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card:hover {
        transform: none;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* --- CHARTS --- */
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid-3 {
        grid-template-columns: 1fr;
    }

    .chart-card {
        padding: 1rem;
    }

    .chart-title {
        font-size: 0.8rem;
    }

    /* --- FORMS --- */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 1.25rem;
    }

    .form-card-title {
        font-size: 1.1rem;
    }

    .search-row {
        flex-direction: column;
    }

    .search-row .btn {
        width: 100%;
    }

    .field-input,
    .field-select,
    .field-textarea {
        font-size: 16px;  /* prevents iOS zoom on focus */
    }

    /* Custom dropdowns: wider touch targets */
    .dropdown-trigger {
        min-height: 48px;
    }

    .dropdown-item {
        min-height: 48px;
        padding: 0.875rem 1rem;
    }

    /* Natureza toggle buttons */
    .natureza-toggle {
        flex-direction: column;
    }

    .natureza-btn {
        min-height: 52px;
        font-size: 0.95rem;
    }

    /* --- BUTTONS: Touch-friendly sizes --- */
    .btn {
        min-height: 48px;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        min-height: 44px;
        padding: 0.625rem 1rem;
    }

    .btn-lg {
        min-height: 52px;
        font-size: 1rem;
    }

    .notif-btn,
    .btn-icon {
        width: 44px;
        height: 44px;
    }

    /* --- FILTERS BAR --- */
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }

    .search-box {
        min-width: unset;
        width: 100%;
    }

    .search-input {
        font-size: 16px;
        min-height: 48px;
    }

    .record-count {
        text-align: center;
    }

    /* --- RECORD CARDS --- */
    .record-card {
        padding: 1rem;
    }

    .record-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .record-badges {
        flex-wrap: wrap;
    }

    .record-body {
        flex-direction: column;
        gap: 0.75rem;
    }

    .record-actions {
        flex-direction: row;
        width: 100%;
        margin-top: 0.5rem;
    }

    .record-actions .btn {
        flex: 1;
    }

    .record-info {
        min-width: 0;
    }

    .record-meta {
        flex-wrap: wrap;
    }

    /* --- MODALS: Full-screen on mobile --- */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius) var(--radius) 0 0;
        padding: 1.25rem;
        margin: 0;
    }

    .modal-lg,
    .modal-xl {
        max-width: 100%;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        top: 0.75rem;
        right: 0.75rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }

    /* Modal evaluation section */
    .modal-avaliar-section {
        padding: 1rem;
    }

    .modal-avaliar-section .btn {
        width: 100%;
    }

    /* --- NOTIFICATIONS PANEL --- */
    .notif-panel {
        width: 100%;
        right: -100%;
    }

    .notif-panel-header {
        padding: 1rem;
        padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    }

    .notif-close-btn {
        width: 40px;
        height: 40px;
    }

    .notif-item {
        padding: 1rem;
        min-height: 48px;
    }

    /* --- DETAIL ROWS --- */
    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .detail-label {
        min-width: unset;
    }

    /* --- EMPLOYEE PROFILE --- */
    .employee-profile-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    /* --- DASHBOARD EXTRAS --- */
    .dash-search-section {
        padding: 1rem;
    }

    .dash-search-row {
        flex-direction: column;
    }

    .dash-search-row .btn {
        width: 100%;
    }

    .dash-section-title {
        font-size: 0.9rem;
    }

    .dash-funcao-grid {
        grid-template-columns: 1fr;
    }

    .dash-rank-item {
        flex-wrap: wrap;
    }

    /* --- HIERARCHY ADMIN --- */
    .hier-cards-grid {
        grid-template-columns: 1fr;
    }

    .hier-toolbar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hier-toolbar .btn {
        width: 100%;
    }

    .hier-card-config {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .hier-cfg {
        min-width: calc(50% - 0.5rem);
    }

    .hier-ind-input {
        font-size: 16px;
    }

    /* --- ADMIN TABS --- */
    .admin-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-tab-btn {
        text-align: center;
        padding: 0.75rem;
        min-height: 48px;
    }

    /* --- TABLE --- */
    .table-responsive {
        overflow-x: auto;
    }

    .data-table th,
    .data-table td {
        font-size: 0.72rem;
        padding: 0.5rem;
        white-space: nowrap;
    }

    /* --- SECTION HEADERS --- */
    .section-header h2 {
        font-size: 1.1rem;
    }

    .section-desc {
        font-size: 0.75rem;
    }

    /* --- HISTORICO MODAL --- */
    .hist-charts-row {
        grid-template-columns: 1fr;
    }

    .hist-stats-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* --- DESCRICAO CARD --- */
    .descricao-body {
        font-size: 0.85rem;
    }

    .descricao-footer {
        flex-direction: column;
        gap: 0.25rem;
    }

    /* --- AUTHOR CARD --- */
    .author-card {
        flex-direction: column;
        gap: 0.5rem;
    }

    .author-date {
        align-self: flex-start;
    }

    /* --- TESTEMUNHA CHIPS --- */
    .testemunhas-chips {
        flex-wrap: wrap;
    }

    .testemunha-chip {
        font-size: 0.75rem;
    }

    /* --- AVALIACAO CARD --- */
    .avaliacao-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* --- TOAST --- */
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        transform: none;
        max-width: none;
        border-radius: var(--radius-sm);
    }

    .toast.show {
        transform: none;
    }

    /* --- LOGIN --- */
    .login-box {
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
    }

    .login-title {
        font-size: 1.4rem;
    }

    .login-subtitle {
        font-size: 0.8rem;
    }

    .login-btn {
        min-height: 52px;
    }

    .login-field input {
        min-height: 52px;
        font-size: 16px;
    }

    .login-hint {
        font-size: 0.72rem;
    }
}

/* ----- SMALL MOBILE: ≤480px ----- */
@media (max-width: 480px) {
    .stats-grid,
    .stats-grid-7 {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }

    /* Tab nav even smaller */
    .tab-btn {
        font-size: 0.55rem;
        min-height: 48px;
        padding: 0.4rem 0.2rem;
    }

    .tab-btn i {
        font-size: 1rem;
    }

    /* Main content tighter */
    .main-content {
        padding: 0.75rem;
        padding-bottom: calc(65px + env(safe-area-inset-bottom, 0px));
    }

    /* Modal nearly full screen */
    .modal-content {
        border-radius: 12px 12px 0 0;
        padding: 1rem;
        max-height: 95vh;
    }

    /* Record card compact */
    .record-card {
        padding: 0.875rem;
    }

    .record-name {
        font-size: 0.85rem;
    }

    .record-meta span {
        font-size: 0.65rem;
    }

    .record-title {
        font-size: 0.85rem;
    }

    /* Badge smaller */
    .badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.45rem;
    }

    /* Dashboard */
    .dash-funcao-grid {
        grid-template-columns: 1fr;
    }

    .dash-section-title {
        font-size: 0.82rem;
    }

    /* Historico modal compact */
    .hist-stats-row {
        gap: 0.3rem;
    }

    .hist-stat {
        min-width: 55px;
        padding: 0.4rem;
    }

    .hist-stat-value {
        font-size: 1.1rem;
    }

    .hist-stat-label {
        font-size: 0.6rem;
    }

    .hist-record-header {
        flex-direction: column;
    }

    /* Form adjustments */
    .form-card {
        padding: 1rem;
    }

    .form-card-title {
        font-size: 0.95rem;
    }

    /* Hierarchy cards compact */
    .hier-card {
        padding: 1rem;
    }

    .hier-card-name {
        font-size: 0.82rem;
    }

    .sub-chip {
        font-size: 0.65rem;
    }

    /* Chart titles */
    .chart-title {
        font-size: 0.75rem;
    }
}

/* ----- VERY SMALL: ≤360px ----- */
@media (max-width: 360px) {
    .header {
        padding: 0.5rem 0.75rem;
    }

    .logo-img {
        width: 28px;
        height: 28px;
    }

    .logo-title {
        font-size: 0.85rem;
    }

    .main-content {
        padding: 0.5rem;
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }

    .stats-grid,
    .stats-grid-7 {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .tab-btn {
        font-size: 0.5rem;
    }

    .tab-btn i {
        font-size: 0.9rem;
    }

    .login-box {
        padding: 1.25rem 1rem;
    }

    .login-title {
        font-size: 1.2rem;
    }
}

/* ----- TOUCH-SPECIFIC ENHANCEMENTS ----- */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover elevations on touch devices (prevent sticky hover) */
    .stat-card:hover,
    .record-card:hover,
    .chart-card:hover,
    .hier-card:hover {
        transform: none;
    }

    /* Tap highlight for feedback */
    .record-card:active,
    .tab-btn:active,
    .btn:active,
    .notif-item:active {
        opacity: 0.85;
        transition: opacity 0.1s;
    }

    /* Larger scrollbar thumb for touch */
    ::-webkit-scrollbar {
        width: 4px;
    }

    ::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 4px;
    }
}

/* ----- LANDSCAPE MOBILE ----- */
@media (max-width: 768px) and (orientation: landscape) {
    .tab-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .tab-btn {
        flex-direction: row;
        gap: 0.3rem;
        font-size: 0.65rem;
        min-height: 40px;
        flex: 0 0 auto;
        padding: 0.4rem 0.75rem;
    }

    .tab-btn i {
        font-size: 0.85rem;
    }

    .main-content {
        padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px));
    }

    .modal-content {
        max-height: 90vh;
    }
}

/* ----- SAFE AREA (Notch/Dynamic Island) ----- */
@supports (padding: env(safe-area-inset-bottom)) {
    .tab-nav {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .login-overlay {
        padding: env(safe-area-inset-top, 1rem) 1rem env(safe-area-inset-bottom, 1rem);
    }
}

/* ----- PRINT ----- */
@media print {
    .tab-nav,
    .header-right,
    .notif-panel,
    .notif-backdrop,
    .toast,
    .modal-overlay,
    .bg-gradient {
        display: none !important;
    }

    body {
        background: white;
        color: #1a1a1a;
    }

    .header {
        position: static;
        background: white;
        border-bottom: 2px solid #1a1a1a;
    }

    .main-content {
        padding: 0;
    }
}


/* ===== ORIGIN BADGES (POR MIM / STAFF) ===== */
.badge-origin-mine {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.65rem;
}

.badge-origin-staff {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.65rem;
}

/* ===== SUBORDINATES INFO (Dashboard) ===== */
.subordinates-info {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.subordinates-info-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.subordinates-info-header i {
    color: var(--primary);
    font-size: 1.1rem;
}

.subordinates-info-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sub-section {
    margin-bottom: 0.75rem;
}

.sub-section:last-child {
    margin-bottom: 0;
}

.sub-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sub-section-title i {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.sub-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sub-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    font-size: 0.73rem;
    font-weight: 500;
}

.sub-chip i {
    font-size: 0.7rem;
}

.sub-chip-funcao {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.sub-chip-count {
    background: rgba(59, 130, 246, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.15rem;
}

.sub-chip-individual {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* ===== SECTION DESCRIPTION ===== */
.section-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* ===== DASHBOARD SEARCH SECTION ===== */
.dash-search-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dash-search-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.dash-search-header i {
    color: var(--primary);
    font-size: 1.2rem;
}

.dash-search-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.dash-search-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.dash-search-row .field-input-wrapper {
    flex: 1;
}

/* ===== STATS GRID 7 COLUMNS ===== */
.stats-grid-7 {
    grid-template-columns: repeat(7, 1fr);
}

.stat-card.stat-highlight {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.08);
}

.stat-card.stat-highlight .stat-icon {
    color: var(--primary);
}

.stat-card.stat-positivo {
    border-color: rgba(34, 197, 94, 0.15);
}

.stat-card.stat-positivo .stat-icon {
    color: var(--success);
}

.stat-card.stat-negativo {
    border-color: rgba(239, 68, 68, 0.15);
}

.stat-card.stat-negativo .stat-icon {
    color: var(--danger);
}

/* ===== CHARTS GRID 3 COLUMNS ===== */
.charts-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ===== SECTION TITLE ===== */
.dash-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--glass-border);
}

.dash-section-title i {
    color: var(--primary);
}

.dash-section-title .section-desc {
    font-weight: 400;
    font-size: 0.78rem;
    margin-top: 0;
}

/* ===== FUNCAO CARDS ===== */
.dash-funcao-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.dash-funcao-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dash-funcao-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.06);
}

.dash-funcao-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.dash-funcao-header > i {
    color: var(--primary);
    font-size: 1rem;
}

.dash-funcao-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dash-funcao-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dash-funcao-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.dash-funcao-stat {
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dash-funcao-stat.pos {
    color: var(--success);
}

.dash-funcao-stat.neg {
    color: var(--danger);
}

.dash-funcao-stat.total {
    color: var(--text-secondary);
}

.dash-funcao-bar-bg {
    height: 6px;
    border-radius: 3px;
    background: rgba(239, 68, 68, 0.25);
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.dash-funcao-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    transition: width 0.6s ease;
}

.dash-funcao-bar-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: right;
}

/* ===== RANKING LIST ===== */
.dash-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dash-rank-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.dash-rank-item:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: var(--glass-bg-hover);
    transform: translateX(4px);
}

.dash-rank-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s;
}

.dash-rank-item:hover .dash-rank-arrow {
    opacity: 1;
}

.mini-badge.total {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

/* ===== MODAL XL ===== */
.modal-xl {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

/* ===== HISTORY PROFILE ===== */
.hist-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.hist-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.hist-info h2 {
    margin: 0 0 0.3rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hist-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.hist-meta i {
    margin-right: 0.3rem;
    color: var(--text-muted);
}

/* ===== HISTORY STATS ROW ===== */
.hist-stats-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.hist-stat {
    flex: 1;
    min-width: 80px;
    padding: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    text-align: center;
}

.hist-stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.hist-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hist-stat-pos {
    border-color: rgba(34, 197, 94, 0.2);
}

.hist-stat-pos .hist-stat-value {
    color: var(--success);
}

.hist-stat-neg {
    border-color: rgba(239, 68, 68, 0.2);
}

.hist-stat-neg .hist-stat-value {
    color: var(--danger);
}

/* ===== HISTORY CHARTS ROW ===== */
.hist-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ===== HISTORY SECTION TITLE ===== */
.hist-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hist-section-title i {
    color: var(--primary);
}

/* ===== HISTORY RECORDS ===== */
.hist-records {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 400px;
    overflow-y: auto;
}

.hist-record {
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.hist-record:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: var(--glass-bg-hover);
}

.hist-record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
}

.hist-record-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    flex: 1;
}

.hist-record-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.73rem;
    color: var(--text-muted);
}

.hist-record-meta i {
    margin-right: 0.2rem;
}

/* ============================================================
   MOBILE RESPONSIVE FIXES — Comprehensive
   Fixes: overflow, charts, bottom nav, search, cards, FAB
   ============================================================ */

/* --- Global overflow containment --- */
.main-app,
.main-content,
.tab-content {
    overflow-x: hidden;
    max-width: 100vw;
}

/* --- Chart canvas overflow fix --- */
.chart-card canvas {
    max-width: 100% !important;
    height: auto !important;
}

.chart-card {
    overflow: hidden;
    min-width: 0;
}

/* --- Dashboard search full-width input --- */
.dash-search-row .field-input-wrapper {
    min-width: 0;
}

/* --- Ranking list item overflow --- */
.dash-rank-item .top-info {
    min-width: 0;
    overflow: hidden;
}

.dash-rank-item .top-name,
.dash-rank-item .top-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----- ENHANCED MOBILE: ≤768px ----- */
@media (max-width: 768px) {
    /* --- Fix header layout --- */
    .header-content {
        max-width: 100%;
    }

    .logo-section {
        min-width: 0;
        flex-shrink: 1;
    }

    .header-right {
        flex-shrink: 0;
    }

    /* --- Bottom nav: scrollable when too many tabs --- */
    .tab-nav {
        justify-content: space-around;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        flex: 1 1 0;
        min-width: 50px;
        max-width: 80px;
        position: relative;
    }

    /* --- Charts single column and contained --- */
    .charts-grid,
    .charts-grid-3 {
        grid-template-columns: 1fr;
    }

    .chart-card {
        overflow: hidden;
        max-width: 100%;
    }

    .chart-card canvas {
        max-width: 100% !important;
    }

    /* --- Dashboard search row full width --- */
    .dash-search-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .dash-search-row .field-input-wrapper {
        width: 100%;
    }

    .dash-search-row .btn {
        width: 100%;
    }

    .dash-search-section {
        padding: 1rem;
        overflow: hidden;
    }

    .dash-search-header h3 {
        font-size: 0.9rem;
    }

    /* --- Stats grid: ensure containment --- */
    .stats-grid,
    .stats-grid-7 {
        max-width: 100%;
        overflow: hidden;
    }

    /* --- Ranking: stack badges below name --- */
    .dash-rank-item {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.65rem 0.75rem;
    }

    .dash-rank-item .top-badges {
        width: 100%;
        justify-content: flex-start;
        gap: 0.4rem;
    }

    .dash-rank-arrow {
        display: none;
    }

    /* --- Funcao cards: single column --- */
    .dash-funcao-grid {
        grid-template-columns: 1fr;
    }

    /* --- Section titles: prevent overflow --- */
    .dash-section-title {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* --- Record cards: prevent horizontal overflow --- */
    .record-card {
        overflow: hidden;
        word-break: break-word;
    }

    .record-badges {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    /* --- Subordinates info: contained --- */
    .subordinates-info {
        overflow: hidden;
    }

    .sub-chips {
        flex-wrap: wrap;
    }

    /* --- Historico modal: contained --- */
    .hist-profile {
        flex-wrap: wrap;
    }

    .hist-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .hist-record-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ----- ENHANCED SMALL MOBILE: ≤480px ----- */
@media (max-width: 480px) {

    /* --- Bottom nav: smaller and scrollable --- */
    .tab-btn {
        min-width: 52px;
        max-width: 72px;
        font-size: 0.5rem;
        padding: 0.35rem 0.15rem;
    }

    .tab-btn i {
        font-size: 0.95rem;
    }

    /* --- Charts: force contained --- */
    .chart-card {
        padding: 0.75rem;
    }

    .chart-title {
        font-size: 0.72rem;
        word-break: break-word;
    }

    /* --- Dashboard search: compact --- */
    .dash-search-section {
        padding: 0.75rem;
    }

    .dash-search-header {
        gap: 0.4rem;
    }

    .dash-search-header h3 {
        font-size: 0.82rem;
    }

    .dash-search-header i {
        font-size: 1rem;
    }

    /* --- Ranking: compact --- */
    .dash-rank-item {
        padding: 0.5rem 0.65rem;
        gap: 0.4rem;
    }

    .top-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.65rem;
    }

    .top-rank {
        font-size: 0.7rem;
        min-width: 28px;
    }

    .top-name {
        font-size: 0.78rem;
    }

    .top-meta {
        font-size: 0.65rem;
    }

    .mini-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.35rem;
    }

    /* --- Funcao cards: compact --- */
    .dash-funcao-card {
        padding: 0.75rem;
    }

    .dash-funcao-name {
        font-size: 0.78rem;
    }

    .dash-funcao-stat {
        font-size: 0.7rem;
    }

    /* --- Modal inside content overflow --- */
    .modal-body {
        overflow-x: hidden;
        word-break: break-word;
    }

    /* --- Avaliacao inline: stack --- */
    .avaliacao-inline-actions {
        flex-direction: column;
    }

    .avaliacao-inline-actions .btn {
        width: 100%;
    }
}

/* ----- ENHANCED VERY SMALL: ≤360px ----- */
@media (max-width: 360px) {

    .tab-btn {
        min-width: 46px;
        max-width: 62px;
        font-size: 0.45rem;
        min-height: 44px;
    }

    .tab-btn i {
        font-size: 0.85rem;
    }

    .dash-search-section {
        padding: 0.6rem;
    }

    .stats-grid,
    .stats-grid-7 {
        gap: 0.35rem;
    }

    .stat-card {
        padding: 0.6rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }
}
