@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/InterVariable.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
}

:root {
    --bg: #F7FAF6;
    --card: #FFFFFF;
    --border: #DCE4DC;
    --border-soft: #F0F2F0;
    --text: #1F2937;
    --text-strong: #202124;
    --text-muted: #667085;
    --text-muted-2: #475467;

    --green: #2F6E3C;
    --green-dark: #285F34;
    --green-light: #EAF6EC;
    --green-border: #74B27A;

    --red: #E53935;
    --red-light: #FDECEC;
    --red-text: #B42318;

    --orange: #F39C12;
    --orange-light: #FEF3E2;
    --orange-text: #B7791F;

    --blue: #2F6BDE;

    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; }

/* ---------- layout ---------- */
.app-shell {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}

.eyebrow {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-strong);
    margin-top: 4px;
}

.page-subtitle {
    font-size: 14.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---------- sidebar ---------- */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 18px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 6px 24px 6px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.sidebar-brand-tag {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    color: #4B5563;
    font-size: 14.5px;
    font-weight: 600;
}

.nav-item:hover {
    background: #F7FAF7;
    text-decoration: none;
}

.nav-item.active {
    background: var(--green-light);
    color: var(--green);
    border-color: var(--green-border);
    font-weight: 700;
}

.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-divider { height: 1px; background: #EEF3EE; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #667085;
    cursor: pointer;
}
.icon-btn:hover { background: var(--red-light); border-color: #F2A6A6; color: var(--red-text); }

/* ---------- cards, tables, buttons ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 900px) {
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.summary-card {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-label { font-size: 14px; font-weight: 600; color: var(--text-muted-2); }
.summary-value { font-size: 27px; font-weight: 700; }
.summary-sub { font-size: 13px; color: var(--text-muted); }

.value-green { color: #2E7D32; }
.value-red { color: var(--red); }
.value-orange { color: var(--orange); }
.value-blue { color: var(--blue); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    padding: 12px;
    font-size: 12.5px;
    color: #36563D;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    background: #F7FAF7;
    border-bottom: 1px solid #E5ECE5;
}
.data-table td {
    padding: 14px 12px;
    font-size: 14.5px;
    color: #374151;
    border-bottom: 1px solid #EEF3EE;
}
.data-table tr:hover td { background: rgba(116, 178, 122, .06); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
}
.badge-pending { background: var(--orange-light); color: var(--orange-text); }
.badge-late { background: var(--red-light); color: var(--red-text); }
.badge-ok { background: var(--green-light); color: var(--green); }
.badge-neutral { background: #F1F5F1; color: #667085; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    padding: 11px 20px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid transparent;
}
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--green); border-color: var(--green-border); }
.btn-outline:hover { background: rgba(116, 178, 122, .09); text-decoration: none; }
.btn-outline-small { padding: 6px 14px; font-size: 12.5px; }

.month-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px 8px;
}
.month-nav a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #4D6B50;
}
.month-nav a:hover { background: #F1F7F1; text-decoration: none; }
.month-nav span {
    font-size: 15px;
    font-weight: 600;
    color: #314236;
    padding: 0 10px;
    min-width: 140px;
    text-align: center;
    display: inline-block;
}

.flash {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}
.flash-error { background: var(--red-light); color: var(--red-text); }
.flash-success { background: var(--green-light); color: var(--green); }

/* ---------- login ---------- */
.login-shell { display: flex; min-height: 100vh; }
.login-brand-panel {
    width: 600px;
    background: var(--green);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px;
    color: #fff;
}
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.login-form-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 26px; }
.input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
}
.input-wrap:focus-within { border-color: var(--green-border); box-shadow: 0 0 0 3px rgba(116,178,122,.15); }
.input-wrap input {
    all: unset;
    flex: 1;
    padding: 15px 0;
    font-size: 14.5px;
    color: var(--text);
    font-family: inherit;
}

.field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.field input, .field select {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14.5px;
    color: var(--text);
    font-family: inherit;
}
.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--green-border);
    box-shadow: 0 0 0 3px rgba(116,178,122,.15);
}

.combo { position: relative; }
.combo-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    z-index: 20;
}
.combo-menu.open { display: block; }
.combo-item {
    padding: 10px 14px;
    font-size: 14.5px;
    color: var(--text);
    cursor: pointer;
}
.combo-item:hover, .combo-item.active { background: var(--green-light); color: var(--green); }

.field-hint { color: var(--text-muted); font-size: 12px; margin-top: 6px; }

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.field-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
}
.field-checkbox input { width: 16px; height: 16px; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 6px;
    border-top: 1px solid var(--border-soft);
    margin-top: 6px;
}

.empty-state {
    color: var(--text-muted);
    font-size: 14.5px;
    padding: 32px 0;
    text-align: center;
}

.section-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-strong);
}

.inline-form { display: inline; }

.report-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.report-tab {
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #4B5563;
    border: 1px solid transparent;
    border-bottom: none;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.report-tab:hover { text-decoration: none; background: #F1F7F1; }
.report-tab.active {
    background: var(--green-light);
    color: var(--green);
    font-weight: 700;
    border-color: var(--green-border);
}

.bar-row { display: flex; align-items: center; gap: 16px; }
.bar-label { width: 140px; font-size: 14px; color: #374151; font-weight: 600; flex-shrink: 0; }
.bar-track { flex: 1; height: 16px; border-radius: 999px; background: #F1F5F1; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--green); }
.bar-value { width: 110px; text-align: right; font-size: 14px; font-weight: 700; color: var(--text-strong); flex-shrink: 0; }

@media (max-width: 700px) {
    .sidebar { display: none; }
    .main-content { padding: 20px; }
    .login-brand-panel { display: none; }
}
