/* Timecard Manager — local styles */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.header-inner { display: flex; align-items: center; gap: 12px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-link:hover { color: var(--accent); background: rgba(0, 255, 157, 0.08); }

.nav-user {
    color: var(--accent);
    font-weight: 600;
    padding: 8px 14px;
    font-size: 0.95rem;
}

.app-main { max-width: 1100px; margin: 0 auto; }

/* Auth pages */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; }

.auth-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-card);
}

.auth-logo { text-align: center; margin-bottom: 12px; }

.auth-title {
    font-size: 1.6rem;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.auth-subtitle { color: var(--text-muted); font-size: 0.95rem; text-align: center; margin-bottom: 20px; }

.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }

.auth-links { text-align: center; margin-top: 18px; color: var(--text-muted); font-size: 0.9rem; }
.auth-links a { color: var(--accent); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.btn-block { width: 100%; }

.user-select { width: auto; min-width: 190px; }

.editing-banner a { color: var(--accent); text-decoration: underline; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.92rem; }
.alert-error { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4); color: #f87171; }
.alert-success { background: rgba(0, 255, 157, 0.1); border: 1px solid rgba(0, 255, 157, 0.4); color: var(--accent); }

/* Period bar */
.period-bar { text-align: center; }

.period-nav { display: flex; align-items: center; justify-content: center; gap: 24px; }

.period-title { font-size: 1.5rem; margin: 0; color: var(--text); }

.period-arrow {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    transition: all 0.2s;
}

.period-arrow:hover { border-color: var(--accent); box-shadow: var(--accent-glow); }

.period-meta { margin-top: 6px; }

.period-totals {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.total-chip {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 6px 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.total-chip b { color: var(--text); margin-left: 6px; }

.total-grand { border-color: var(--accent); }
.total-grand b { color: var(--accent); }

/* Toolbar */
.tc-toolbar { justify-content: flex-end; margin-bottom: 20px; }
.tc-toolbar .text-muted { flex: 1; font-size: 0.85rem; }

.save-status { font-size: 0.9rem; }
.save-status.saving { color: var(--text-muted); }
.save-status.saved { color: var(--accent); }
.save-status.error { color: #f87171; }

/* Day cards */
.tc-grid { display: flex; flex-direction: column; gap: 14px; }

.day-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
}

.day-card.dirty { border-color: var(--accent); }

.day-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.day-date { font-weight: 600; font-size: 1rem; }

.day-total { color: var(--accent); font-weight: 700; font-size: 0.95rem; }

.add-line {
    margin-left: auto;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    color: var(--accent);
    font-size: 0.85rem;
    cursor: pointer;
}

.add-line:hover { border-color: var(--accent); }

.lines { display: flex; flex-direction: column; gap: 8px; }

.line {
    display: grid;
    grid-template-columns: 110px 150px 150px 90px 1fr 36px;
    gap: 8px;
    align-items: center;
}

.line .type,
.line .in,
.line .out,
.line .hours,
.line .note {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    color: var(--text);
    font-size: 0.9rem;
}

.line input[type="number"].hours { -moz-appearance: textfield; }
.line input[type="number"].hours::-webkit-outer-spin-button,
.line input[type="number"].hours::-webkit-inner-spin-button { -webkit-appearance: none; }

.line .hours:read-only { color: var(--text-muted); }

.line input:disabled { opacity: 0.4; }

.del-line {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: #f87171;
    font-size: 1.05rem;
    line-height: 1;
    height: 34px;
    cursor: pointer;
}

.del-line:hover { border-color: #f87171; }

/* Periods list */
.period-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 12px;
}

.period-row h3 { font-size: 1.05rem; margin: 0 0 2px 0; }
.period-row .meta { color: var(--text-muted); font-size: 0.85rem; }

.period-row.grand-total { border-color: var(--accent); background: rgba(0, 255, 157, 0.05); }
.period-row.grand-total .meta strong { color: var(--accent); font-size: 1.1em; }

.period-row .actions { display: flex; gap: 10px; }

.btn-sm {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    color: var(--text);
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* Users admin */
.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.table th { color: var(--accent); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table tr:last-child td { border-bottom: none; }
.table .row-total { color: var(--accent); font-weight: 700; }
.table .grand-row td { background: var(--bg-input); font-weight: 700; border-top: 2px solid var(--accent); }

.badge-on { color: var(--accent); }
.badge-off { color: #f87171; }
.badge-warn { color: #ffb74d; }

.form-row { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.form-row .input, .form-row .select { max-width: 420px; }

@media (max-width: 720px) {
    .line { grid-template-columns: 1fr 1fr 1fr; }
    .line .note { grid-column: 1 / -1; }
    .line .del-line { grid-column: 3; justify-self: end; }
    .site-header { justify-content: center; }
}
