:root {
    --primary: #FA6801;
    --primary-hover: #e05e01;
    --secondary: #34A9AD;
    --orange-light: #fef0e6;
    --orange-border: #fcd2b3;
    
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    
    --text-main: #1E1E1E;
    --text-muted: #6c757d;
    --text-light: #adb5bd;
    
    --border-color: #e9ecef;
    --error: #dc3545;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(250, 104, 1, 0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================================
   UTILITIES
   ========================================================================= */
.text-orange { color: var(--primary) !important; }

/* Buttons */
button {
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px rgba(250, 104, 1, 0.2);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(250, 104, 1, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    background-color: var(--bg-main);
    border-color: var(--text-muted);
}

.btn-danger {
    background-color: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    padding: 10px 15px;
}
.btn-danger:hover {
    background-color: var(--error);
    color: #fff;
}

/* Badges */
.badge {
    background-color: var(--orange-light);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--orange-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================================================
   LOGIN SCREEN
   ========================================================================= */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.login-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}
.login-header .logo img {
    margin-bottom: 15px;
    box-shadow: var(--shadow-md);
}
.login-header h2 {
    font-weight: 700;
    color: var(--text-main);
}
.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 20px;
}
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrapper ion-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    font-size: 1.2rem;
}
.input-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #fafafa;
}
.input-wrapper input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(250, 104, 1, 0.1);
    outline: none;
}

.btn-primary { width: 100%; padding: 14px; font-size: 1rem; margin-top: 10px; }

.error-msg {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-align: center;
}

/* =========================================================================
   DASHBOARD SCREEN
   ========================================================================= */
.dashboard-screen {
    min-height: 100vh;
    padding-bottom: 50px;
}

/* Header */
.app-header {
    background: var(--bg-card);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}
.header-titles h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}
.header-titles p {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.quote-area p {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
    line-height: 1.4;
}
.quote-area b {
    color: var(--text-main);
    letter-spacing: 0.5px;
}

/* Filters */
.filters-bar {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.filters {
    display: flex;
    gap: 20px;
}
.filter-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.select-wrapper select {
    appearance: none;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>') no-repeat right 10px center;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    min-width: 220px;
    cursor: pointer;
}
.select-wrapper select:focus {
    border-color: var(--primary);
    outline: none;
}
.actions {
    display: flex;
    gap: 10px;
}

/* Main Content */
.dashboard-content {
    margin: 0 40px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.report-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
}
.report-header h2 {
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 5px;
}
.report-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Table */
.table-container {
    overflow-x: auto;
    width: 100%;
}
table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}
th, td {
    padding: 12px 6px;
    text-align: center;
    border: 1px solid #dee2e6 !important;
    font-size: 0.85rem;
}
th {
    background-color: #fafbfc;
    font-weight: 600;
    color: var(--text-muted);
}
td {
    color: var(--text-light);
}
td.colab-name {
    text-align: left;
    padding-left: 30px;
    font-weight: 500;
    color: var(--text-main);
    position: sticky;
    left: 0;
    background: var(--bg-card);
    z-index: 10;
    text-transform: capitalize;
    border: 1px solid #dee2e6 !important;
}
th.colab-header {
    text-align: left;
    padding-left: 30px;
    position: sticky;
    left: 0;
    background: #fafbfc;
    z-index: 11;
}

/* Styling for days off (X) */
td.day-off {
    color: var(--primary);
    font-weight: 700;
    background-color: var(--orange-light);
}

/* Styling for weekends/holidays */
th.weekend, td.weekend {
    background-color: #fcfcfc;
}

/* Hover effects */
tbody tr:hover td {
    background-color: #f8f9fa;
}
tbody tr:hover td.colab-name {
    background-color: #f8f9fa;
}
tbody tr:hover td.day-off {
    background-color: var(--orange-border);
}

/* Novo Estilo DM */
td.dm-badge {
    color: var(--secondary);
    font-weight: 700;
    background-color: #e9f7f8;
}
tbody tr:hover td.dm-badge {
    background-color: #d1edef;
}

/* =========================================================================
   PRINT STYLES
   ========================================================================= */
@media print {
    body {
        background-color: white !important;
        margin: 0;
        padding: 0;
        font-size: 0.8rem; /* Reduz globalmente */
    }
    .app-header, .filters-bar, .report-legend {
        display: none !important;
    }
    .dashboard-content {
        box-shadow: none !important;
        margin: 0 !important;
        border: none !important;
    }
    /* CORREÇÃO DO BUG DO CHROME: Elementos Sticky perdem as bordas ao imprimir com table collapse */
    td.colab-name, th.colab-header {
        position: static !important;
    }
    .report-header {
        padding: 10px 0 !important;
    }
    .report-header h2 {
        font-size: 1.1rem !important;
    }
    table, th, td {
        border: 1px solid #666 !important;
    }
    th, td {
        padding: 4px 2px !important; /* Esmaga o espaçamento vertical entre nomes */
        font-size: 0.68rem !important; /* ~20% menor que o original de 0.85rem */
    }
    @page {
        size: landscape;
        margin: 0.5cm;
    }
}
