/* ============================================================================
   BASE.CSS — Reset, Variáveis e Tipografia
   Time Fly — Controle de Horas por Projeto
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============================================================================
   VARIÁVEIS
   ============================================================================ */

:root {
    /* Cores principais */
    --bg:           #f0f4f8;
    --bg2:          #e6eef7;
    --bg3:          #dce8f4;
    --surface:      #ffffff;
    --border:       #dce6f0;
    --border2:      #c4d8ee;

    /* Azul primário */
    --blue:         #1558a8;
    --blue2:        #2e9fd4;
    --blue-light:   #eff6ff;

    /* Textos */
    --text:         #0a1f36;
    --text2:        #1e3a55;
    --text3:        #7a9ab8;
    --text4:        #94b4cc;

    /* Estados */
    --success:        #166534;
    --success-bg:     #f0fdf4;
    --success-border: #86efac;

    --warning:        #854d0e;
    --warning-bg:     #fefce8;
    --warning-border: #fde047;

    --danger:         #c0392b;
    --danger-bg:      #fff1f1;
    --danger-border:  #fca5a5;

    /* Timer ativo */
    --timer-green:    #10b981;
    --timer-green-bg: #ecfdf5;
    --timer-pause:    #f59e0b;
    --timer-pause-bg: #fffbeb;

    /* Sombras */
    --shadow-sm:  0 1px 4px rgba(15,50,100,0.06);
    --shadow-md:  0 2px 14px rgba(15,50,100,0.08);
    --shadow-lg:  0 6px 28px rgba(15,50,100,0.13);

    /* Layout */
    --header-h:   60px;
    --radius:     12px;
    --radius-lg:  16px;
    --radius-sm:  8px;
}

/* ============================================================================
   RESET
   ============================================================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

button {
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
}

input, select, textarea {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ============================================================================
   HEADER
   ============================================================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 24px;
}

.header-logo {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo-bar {
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, var(--blue), var(--blue2));
    border-radius: 2px;
}

.header-logo span {
    color: var(--blue2);
    font-weight: 400;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text3);
    text-decoration: none;
    transition: all 0.15s;
}

.nav-link:hover {
    background: var(--bg2);
    color: var(--text2);
}

.nav-link.active {
    background: var(--blue-light);
    color: var(--blue);
}

/* Badge do timer no header */
.header-timer-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--timer-green-bg);
    border: 1.5px solid var(--success-border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--timer-green);
    flex-shrink: 0;
}

.header-timer-badge.pausado {
    background: var(--timer-pause-bg);
    border-color: var(--warning-border);
    color: var(--timer-pause);
}

.timer-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--timer-green);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.header-timer-badge.pausado .timer-badge-dot {
    background: var(--timer-pause);
    animation: none;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

/* Relógio no header */
.header-relogio {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    line-height: 1.2;
}

.header-relogio-hora {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}

.header-relogio-data {
    font-size: 10px;
    font-weight: 500;
    color: var(--text3);
}

/* ============================================================================
   MAIN
   ============================================================================ */

.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 32px;
}

/* ============================================================================
   TIPOGRAFIA
   ============================================================================ */

.page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text3);
    margin-top: 2px;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================================================
   UTILITÁRIOS
   ============================================================================ */

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.gap-20      { gap: 20px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }

.text-muted  { color: var(--text4); font-size: 12px; }
.text-center { text-align: center; }

/* ============================================================================
   HELPERS DE TEMPO (usados em múltiplas telas)
   ============================================================================ */

.horas-display {
    font-size: 13px;
    font-weight: 700;
    color: var(--blue);
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text3);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 20px;
}

/* ============================================================================
   SCROLLBAR CUSTOMIZADA
   ============================================================================ */

::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text4); }

/* ============================================================================
   RESPONSIVO
   ============================================================================ */

@media (max-width: 768px) {
    .header { padding: 0 16px; }
    .main   { padding: 20px 16px; }

    .header-nav .nav-link span {
        display: none;
    }
}
