:root {
    --rt-ink: #1f2933;
    --rt-muted: #667085;
    --rt-line: #d9e2ec;
    --rt-bg: #f4f7fb;
    --rt-panel: #ffffff;
    --rt-primary: #1f6f8b;
    --rt-primary-dark: #155a73;
    --rt-accent: #2f9e7e;
    --rt-danger: #b42318;
    --rt-warning: #b7791f;
}

html {
    background: var(--rt-bg);
}

body {
    background:
        linear-gradient(180deg, #eef6fa 0, var(--rt-bg) 240px),
        var(--rt-bg);
    color: var(--rt-ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-shell {
    max-width: 1240px;
}

.app-navbar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--rt-line);
    box-shadow: 0 10px 30px rgba(31, 41, 51, 0.06);
}

.navbar-brand {
    color: var(--rt-primary-dark);
    font-weight: 700;
    letter-spacing: 0;
}

.nav-link {
    color: var(--rt-muted);
    font-weight: 500;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--rt-primary);
}

.page-title-row {
    align-items: center;
    border-bottom: 1px solid rgba(217, 226, 236, 0.8);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
}

h1,
h2,
h3,
h4 {
    color: var(--rt-ink);
    letter-spacing: 0;
}

.page-title-row h2 {
    font-size: 1.55rem;
    font-weight: 700;
}

.table-wrap {
    border: 1px solid var(--rt-line);
    border-radius: 8px;
    overflow-x: auto;
    background: var(--rt-panel);
    box-shadow: 0 12px 30px rgba(31, 41, 51, 0.05);
}

.table {
    background: var(--rt-panel);
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom-color: var(--rt-line);
    color: #344054;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.table td {
    color: #344054;
    vertical-align: middle;
}

.actions,
.table td:last-child {
    white-space: nowrap;
}

.form-control,
.form-select {
    border-color: #cbd5e1;
    border-radius: 6px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--rt-primary);
    box-shadow: 0 0 0 0.2rem rgba(31, 111, 139, 0.15);
}

.form-panel,
form.bg-white.border.rounded {
    border-color: var(--rt-line) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 24px rgba(31, 41, 51, 0.05);
}

.btn {
    border-radius: 6px;
    font-weight: 600;
}

.btn-primary,
.btn-success {
    background: var(--rt-primary);
    border-color: var(--rt-primary);
}

.btn-primary:hover,
.btn-success:hover {
    background: var(--rt-primary-dark);
    border-color: var(--rt-primary-dark);
}

.btn-outline-primary,
.btn-outline-info,
.btn-outline-success,
.btn-outline-dark {
    border-color: var(--rt-primary);
    color: var(--rt-primary-dark);
}

.btn-outline-primary:hover,
.btn-outline-info:hover,
.btn-outline-success:hover,
.btn-outline-dark:hover {
    background: var(--rt-primary);
    border-color: var(--rt-primary);
    color: #fff;
}

.btn-outline-secondary {
    border-color: #98a2b3;
    color: #475467;
}

.btn-danger,
.btn-outline-danger:hover {
    background: var(--rt-danger);
    border-color: var(--rt-danger);
}

.btn-warning {
    background: #f6c453;
    border-color: #f6c453;
    color: #3d2f00;
}

.alert {
    border-radius: 8px;
}

.dashboard-hero,
.login-panel {
    background: var(--rt-panel);
    border: 1px solid var(--rt-line);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(31, 41, 51, 0.08);
}

.dashboard-logo,
.login-logo {
    max-width: 120px;
}

.dashboard-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dashboard-link {
    align-items: flex-start;
    background: var(--rt-panel);
    border: 1px solid var(--rt-line);
    border-radius: 8px;
    color: var(--rt-ink);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 96px;
    padding: 1rem;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dashboard-link:hover,
.dashboard-link:focus {
    border-color: rgba(31, 111, 139, 0.45);
    box-shadow: 0 14px 28px rgba(31, 41, 51, 0.08);
    color: var(--rt-ink);
    transform: translateY(-1px);
}

.dashboard-link strong {
    color: var(--rt-primary-dark);
    font-size: 1rem;
}

.dashboard-link span {
    color: var(--rt-muted);
    font-size: 0.9rem;
}

.stat-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--rt-panel);
    border: 1px solid var(--rt-line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(31, 41, 51, 0.05);
    padding: 1rem;
}

.stat-card .label {
    color: var(--rt-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.stat-card .value {
    color: var(--rt-primary-dark);
    font-size: 1.8rem;
    font-weight: 750;
    line-height: 1.15;
    margin-top: 0.25rem;
}

.stat-card .hint {
    color: var(--rt-muted);
    font-size: 0.88rem;
    margin-top: 0.35rem;
}

.section-heading {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.5rem 0 0.75rem;
}

.login-page {
    min-height: 100vh;
}

.login-panel {
    max-width: 430px;
    padding: 2rem;
}

.login-panel label {
    color: #344054;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .page-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .page-title-row .btn {
        width: 100%;
    }

    .login-panel {
        padding: 1.25rem;
    }
}
