:root {
    --app-bg: #f5f7fa;
    --app-surface: #ffffff;
    --app-border: #dfe5ec;
    --app-text: #17202a;
    --app-muted: #64748b;
    --app-primary: #1864ab;
    --app-accent: #0f766e;
    --app-warm: #b45309;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
    font-size: 0.95rem;
    letter-spacing: 0;
}

.app-navbar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--app-border);
    backdrop-filter: blur(12px);
}

.navbar-brand {
    color: var(--app-text);
    font-weight: 700;
}

.brand-mark {
    align-items: center;
    background: #e7f5ff;
    border: 1px solid #c5e4ff;
    border-radius: 8px;
    color: var(--app-primary);
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.nav-link {
    align-items: center;
    border-radius: 8px;
    color: #425466;
    display: inline-flex;
    gap: 0.45rem;
    margin: 0 0.1rem;
    padding: 0.55rem 0.75rem;
}

.nav-link.active,
.nav-link:hover {
    background: #eef6ff;
    color: var(--app-primary);
}

.app-main {
    min-height: calc(100vh - 64px);
}

.login-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 3rem);
}

.login-panel {
    max-width: 440px;
    width: 100%;
}

.login-panel h1 {
    font-size: 1.65rem;
    font-weight: 760;
}

.page-title {
    margin-bottom: 1.25rem;
}

.page-title h1 {
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    font-weight: 750;
    margin: 0;
}

.page-title p {
    color: var(--app-muted);
    margin: 0.35rem 0 0;
    max-width: 780px;
}

.surface {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.surface-header {
    align-items: center;
    border-bottom: 1px solid var(--app-border);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.15rem;
}

.surface-body {
    padding: 1.15rem;
}

.metric {
    min-height: 112px;
    padding: 1rem;
}

.metric-label {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.metric-value {
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 760;
    line-height: 1.1;
    margin-top: 0.45rem;
}

.metric-hint {
    color: var(--app-muted);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.table {
    margin-bottom: 0;
}

.table th {
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.btn {
    border-radius: 8px;
}

.form-control,
.form-select {
    border-color: #ced7e0;
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: #74b5e8;
    box-shadow: 0 0 0 0.2rem rgba(24, 100, 171, 0.12);
}

.empty-state {
    max-width: 580px;
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state h1 {
    font-size: 1.45rem;
    font-weight: 750;
}

.empty-state p {
    color: var(--app-muted);
}

.empty-icon {
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: var(--app-warm);
    display: inline-flex;
    font-size: 1.4rem;
    height: 48px;
    justify-content: center;
    margin-bottom: 1rem;
    width: 48px;
}

.group-title {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.document-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.document-list li {
    align-items: center;
    border-top: 1px solid var(--app-border);
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.85rem 0;
}

.document-list li:first-child {
    border-top: 0;
}

.text-money-positive {
    color: #087f5b;
    font-weight: 700;
}

.text-money-negative {
    color: #c92a2a;
    font-weight: 700;
}

.notes-cell {
    max-width: 280px;
    white-space: normal;
}

@media (max-width: 768px) {
    .surface-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-responsive {
        border: 1px solid var(--app-border);
        border-radius: 8px;
    }

    .user-area {
        align-items: flex-start !important;
        flex-direction: column;
        margin-top: 0.75rem;
    }
}
