/* VNCO Time Tracker - Utilitarian Dashboard */

:root {
    --bg: #0f1117;
    --bg-card: #181a24;
    --bg-card-hover: #1e2030;
    --bg-input: #1e2030;
    --border: #2a2d3e;
    --border-light: #353849;
    --text: #e2e4ed;
    --text-muted: #8b8fa3;
    --text-dim: #5c5f73;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-bg: rgba(99, 102, 241, 0.12);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --font: 'DM Sans', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted);
}

/* Navigation */
.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left { display: flex; align-items: center; gap: 0; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-link { color: var(--text-muted); font-size: 0.875rem; font-weight: 500; }
.nav-link:hover { color: var(--text); }
.nav-link-muted { color: var(--text-dim); }
.brand-link { display: flex; align-items: center; text-decoration: none; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.brand-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

.container-narrow { max-width: 600px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 24px;
}

/* Sections */
.section { margin-bottom: 40px; }

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

/* Charts */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-wrap {
    position: relative;
    height: 280px;
}

/* Week Cards */
.week-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.week-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.week-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--mono);
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1px;
    background: var(--border);
}

.member-card {
    background: var(--bg-card);
    padding: 20px 24px;
}

.member-missing { opacity: 0.4; }

.member-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.member-avatar-missing { background: var(--text-dim); }

.member-name { font-weight: 600; font-size: 0.95rem; }
.member-total { font-family: var(--mono); font-size: 0.85rem; color: var(--text-muted); }
.missing-text { color: var(--warning); }

/* Project Bars */
.project-bars { display: flex; flex-direction: column; gap: 8px; }

.project-row {
    display: grid;
    grid-template-columns: 130px 1fr 56px 40px;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.project-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-bar-wrap {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.project-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.project-value {
    font-family: var(--mono);
    font-size: 0.75rem;
    text-align: right;
    color: var(--text);
}

.project-pct {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-align: right;
}

.member-meta {
    margin-top: 12px;
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* Flash Messages */
.flash-messages { margin-bottom: 20px; }

.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.flash-error { background: var(--error-bg); color: var(--error); border: 1px solid rgba(239,68,68,0.2); }

.alert { padding: 14px 18px; border-radius: var(--radius); font-size: 0.875rem; margin-bottom: 24px; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }

/* Forms */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus { border-color: var(--accent); }

/* Upload */
.upload-form { margin-top: 20px; }

.drop-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.drop-zone input[type="file"] { display: none; }

.drop-icon { font-size: 2.5rem; margin-bottom: 12px; }
.drop-text { font-weight: 600; margin-bottom: 4px; }
.drop-hint { color: var(--text-dim); font-size: 0.8rem; }

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--accent-bg);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.file-name { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }

.btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}
.btn-remove:hover { color: var(--error); }

.upload-info {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.upload-info h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.upload-info p {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-container {
    width: 100%;
    max-width: 380px;
}

.login-brand {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
    justify-content: center;
}

.login-form .form-group { margin-bottom: 16px; }
.login-form .btn { margin-top: 8px; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h2 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text); }
.empty-state p { margin-bottom: 24px; font-size: 0.9rem; }

.settings-form { margin-top: 20px; }
.settings-form .btn { margin-top: 8px; }

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
    margin-right: 4px;
}

.filter-btn {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

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

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Reports Management Page */
.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 28px;
}

.member-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.member-section-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.report-count {
    font-size: 0.75rem;
    color: var(--text-dim);
    background: var(--bg-input);
    padding: 2px 10px;
    border-radius: 12px;
}

.reports-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
}

.reports-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.reports-table thead {
    background: var(--bg-input);
}

.reports-table th {
    padding: 10px 16px;
    text-align: left;
    font-weight: 500;
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reports-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.td-mono { font-family: var(--mono); font-size: 0.8rem; }
.td-muted { color: var(--text-dim); }

.td-action { text-align: right; width: 48px; }

.btn-delete {
    background: none;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-delete:hover {
    color: var(--error);
    border-color: var(--error);
    background: var(--error-bg);
}

/* Responsive */
@media (max-width: 768px) {
    .chart-grid { grid-template-columns: 1fr; }
    .member-grid { grid-template-columns: 1fr; }
    .project-row { grid-template-columns: 100px 1fr 50px 36px; }
    .topnav { padding: 0 16px; }
    .container { padding: 20px 16px; }
    .nav-right { gap: 10px; }
    .nav-link { font-size: 0.8rem; }
    .reports-table { font-size: 0.75rem; }
    .reports-table th, .reports-table td { padding: 8px 10px; }
}
