:root {
    --app-navy: #12324a;
    --app-blue: #2563eb;
    --app-teal: #0f766e;
    --app-ink: #17212f;
    --app-muted: #667085;
    --app-bg: #f4f7fb;
    --app-line: #e4e9f2;
}

body {
    background: var(--app-bg);
    color: var(--app-ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-navbar {
    background: linear-gradient(90deg, var(--app-navy), #174668);
    box-shadow: 0 8px 24px rgba(18, 50, 74, .18);
}

.navbar-brand {
    letter-spacing: 0;
}

.app-shell {
    min-height: calc(100vh - 56px);
}

.login-shell {
    min-height: 100vh;
    background: linear-gradient(135deg, #12324a 0%, #165b63 52%, #edf7f5 52%, #f7fafc 100%);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(460px, 100%);
    background: #fff;
    border-radius: 8px;
    padding: 32px;
}

.login-brand {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
}

.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--app-teal);
    color: white;
    font-weight: 800;
    font-size: 28px;
}

.login-brand h1,
.page-heading h1 {
    margin: 0;
    font-weight: 800;
    letter-spacing: 0;
}

.login-brand p,
.eyebrow {
    margin: 0;
    color: var(--app-muted);
}

.login-note {
    border-top: 1px solid var(--app-line);
    margin-top: 24px;
    padding-top: 16px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 22px;
}

.page-heading.compact {
    margin-bottom: 16px;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--app-teal);
}

.summary-card,
.content-panel,
.side-note {
    background: #fff;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(25, 47, 74, .06);
}

.summary-card {
    padding: 20px;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.summary-card::after {
    content: "";
    position: absolute;
    inset: auto 16px 16px auto;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    opacity: .12;
    background: currentColor;
}

.summary-card span {
    display: block;
    color: var(--app-muted);
    font-weight: 700;
    font-size: 13px;
}

.summary-card strong {
    display: block;
    font-size: 40px;
    line-height: 1.1;
    margin-top: 14px;
}

.summary-card.total { color: var(--app-navy); }
.summary-card.pending { color: #b45309; }
.summary-card.progress { color: var(--app-blue); }
.summary-card.resolved { color: #15803d; }

.content-panel,
.side-note {
    padding: 22px;
}

.panel-title,
.detail-panel h2,
.side-note h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 16px;
}

.app-table thead th {
    background: #f8fafc;
    color: #475467;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--app-line);
}

.app-table td,
.app-table th {
    padding: 14px 12px;
}

.form-control,
.form-select,
.btn {
    border-radius: 8px;
}

.btn-primary {
    background: var(--app-blue);
    border-color: var(--app-blue);
}

.side-note {
    background: #f0fdfa;
    border-color: #b9eee5;
}

.photo-preview,
.report-photo {
    margin-top: 14px;
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--app-line);
}

.report-photo {
    max-height: 420px;
}

.empty-photo {
    display: grid;
    place-items: center;
    min-height: 180px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--app-muted);
    background: #f8fafc;
}

.detail-list dt {
    color: var(--app-muted);
    font-weight: 700;
}

.detail-list dd {
    margin-bottom: 14px;
}

@media (max-width: 767.98px) {
    .panel-heading,
    .month-form {
        align-items: stretch;
        flex-direction: column;
    }

    .month-form .form-control {
        min-width: 0;
        width: 100%;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .login-panel {
        padding: 24px;
    }

    .summary-card {
        min-height: 104px;
        padding: 16px;
    }

    .summary-card strong {
        font-size: 32px;
    }
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
}

.month-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.month-form .form-control {
    min-width: 170px;
}

.monthly-panel {
    border-left: 4px solid var(--app-teal);
}

.monthly-stats {
    margin-bottom: 4px;
}

.mini-stat {
    border: 1px solid var(--app-line);
    border-radius: 8px;
    padding: 16px;
    background: #f8fafc;
}

.mini-stat span {
    display: block;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.mini-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    line-height: 1;
}

.mini-stat.pending strong { color: #b45309; }
.mini-stat.progress strong { color: var(--app-blue); }
.mini-stat.resolved strong { color: #15803d; }

.compact-table tfoot th {
    background: #eef6f5;
    border-top: 1px solid #b9eee5;
}

.month-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.print-body {
    background: #e8edf3;
    color: #111827;
}

.print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    max-width: 1120px;
    margin: 20px auto 12px;
    padding: 0 16px;
}

.print-sheet {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto 32px;
    background: #fff;
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 18px 48px rgba(17, 24, 39, .14);
}

.print-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 3px solid var(--app-navy);
    padding-bottom: 18px;
    margin-bottom: 20px;
}

.print-kicker {
    margin: 0 0 4px;
    color: var(--app-teal);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 12px;
}

.print-header h1 {
    margin: 0 0 4px;
    font-size: 26px;
    font-weight: 800;
}

.print-header p {
    margin: 0;
}

.print-meta {
    min-width: 260px;
    display: grid;
    gap: 4px;
    align-content: start;
    color: #475467;
    font-size: 13px;
    text-align: right;
}

.print-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

.print-summary div {
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.print-summary span {
    display: block;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.print-summary strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
    line-height: 1;
}

.print-section {
    margin-top: 20px;
}

.print-section h2 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 10px;
}

.print-table {
    font-size: 13px;
}

.print-table th {
    background: #f1f5f9;
}

.print-table tfoot th {
    background: #eef6f5;
}

.print-footer {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    margin-top: 34px;
}

.signature-block {
    text-align: center;
}

.signature-block p {
    margin-bottom: 6px;
}

.signature-space {
    height: 72px;
}

@media (max-width: 767.98px) {
    .month-actions,
    .month-form {
        width: 100%;
    }

    .month-actions .btn,
    .month-form .btn {
        width: 100%;
    }

    .print-header,
    .print-footer {
        grid-template-columns: 1fr;
        display: grid;
    }

    .print-meta {
        text-align: left;
    }

    .print-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    body.print-body {
        background: #fff;
    }

    .no-print {
        display: none !important;
    }

    .print-sheet {
        width: 100%;
        margin: 0;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .print-header {
        break-after: avoid;
    }

    .print-section,
    .print-summary,
    .print-table tr {
        break-inside: avoid;
    }

    .print-table {
        font-size: 11px;
    }

    .print-summary {
        grid-template-columns: repeat(4, 1fr);
    }
}
