:root {
    --navy: #10243e;
    --navy-2: #193959;
    --coral: #f06b5b;
    --coral-dark: #dc5849;
    --teal: #4fa99a;
    --cream: #f8f5ef;
    --surface: #ffffff;
    --muted: #6f7c8c;
    --line: #e6ebf0;
    --shadow: 0 12px 36px rgba(16, 36, 62, .09);
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    background: #f4f6f8;
    color: var(--navy);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.app-container { max-width: 1040px; }
.has-bottom-nav { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

.app-header {
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(16, 36, 62, .06);
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(16px);
}

.brand {
    color: var(--navy);
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    font-size: 1.05rem;
    font-weight: 750;
    text-decoration: none;
}

.brand img { border-radius: 12px; }
.btn-ghost { color: var(--muted); font-size: 1.25rem; }
.btn-ghost:hover { color: var(--coral); background: #fff0ee; }

.btn-primary {
    --bs-btn-bg: var(--coral);
    --bs-btn-border-color: var(--coral);
    --bs-btn-hover-bg: var(--coral-dark);
    --bs-btn-hover-border-color: var(--coral-dark);
    --bs-btn-active-bg: var(--coral-dark);
    --bs-btn-active-border-color: var(--coral-dark);
    --bs-btn-disabled-bg: var(--coral);
    --bs-btn-disabled-border-color: var(--coral);
    font-weight: 650;
}

.btn-outline-primary {
    --bs-btn-color: var(--coral-dark);
    --bs-btn-border-color: #f4aaa1;
    --bs-btn-hover-bg: var(--coral);
    --bs-btn-hover-border-color: var(--coral);
}

.form-control:focus, .form-select:focus {
    border-color: #f4aaa1;
    box-shadow: 0 0 0 .25rem rgba(240, 107, 91, .13);
}

.hero-card {
    position: relative;
    overflow: hidden;
    min-height: 154px;
    padding: 1.5rem;
    border-radius: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: #fff;
    background: var(--navy);
    box-shadow: 0 18px 42px rgba(16, 36, 62, .2);
}

.hero-card::after {
    content: "";
    position: absolute;
    width: 210px;
    height: 210px;
    right: -90px;
    top: -105px;
    border: 38px solid rgba(79, 169, 154, .18);
    border-radius: 50%;
}

.hero-card > * { position: relative; z-index: 1; }
.eyebrow { color: var(--teal); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-card .eyebrow { color: #87d0c4; }

.count-badge {
    min-width: 96px;
    height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
}

.count-badge strong { font-size: 2rem; line-height: 1; }
.count-badge span { font-size: .68rem; color: rgba(255, 255, 255, .76); margin-top: .35rem; }
.card, .modal-content { border-radius: 20px; }
.date-navigator .card-body { padding: .7rem; }
.icon-button { width: 42px; flex: 0 0 42px; }

.action-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: .75rem;
}

.btn-add-now {
    min-height: 70px;
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    align-content: center;
    justify-content: center;
    column-gap: .65rem;
    text-align: left;
    border-radius: 18px;
    box-shadow: 0 10px 22px rgba(240, 107, 91, .22);
}

.btn-add-now i { grid-row: 1 / 3; align-self: center; font-size: 1.35rem; }
.btn-add-now small { font-weight: 500; opacity: .78; line-height: 1; }
.btn-soft { color: var(--navy); background: #e9f4f2; border-color: #d7ebe7; border-radius: 18px; font-weight: 650; }
.btn-soft:hover { color: var(--navy); background: #dcefeb; border-color: #c5e2dc; }
.content-card { box-shadow: var(--shadow) !important; }
.badge.text-bg-light { color: var(--navy) !important; background: #edf1f4 !important; }

.empty-state { padding: 2.8rem 1rem; text-align: center; color: var(--muted); }
.empty-state i { display: block; color: var(--teal); font-size: 2.4rem; margin-bottom: .65rem; }
.time-pill { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.05rem; font-weight: 700; }
.time-pill i { color: var(--teal); }
.btn-delete { color: #bf5145; background: #fff0ee; border-radius: 10px; }
.btn-delete:hover { color: #fff; background: #d85b4d; }
table.dataTable > tbody > tr > td { padding-top: .85rem; padding-bottom: .85rem; border-color: var(--line); }
.dt-layout-row:last-child { margin-top: 1rem; }
.page-link { color: var(--navy); border-color: var(--line); }
.active > .page-link { background-color: var(--coral); border-color: var(--coral); }

.bottom-nav {
    position: fixed;
    z-index: 1030;
    left: 50%;
    bottom: max(.7rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(calc(100% - 1.5rem), 420px);
    padding: .45rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .25rem;
    background: rgba(16, 36, 62, .96);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    box-shadow: 0 16px 38px rgba(16, 36, 62, .28);
    backdrop-filter: blur(14px);
}

.bottom-nav__item { color: #aebac7; display: flex; flex-direction: column; align-items: center; gap: .12rem; padding: .48rem; border-radius: 14px; text-decoration: none; font-size: .68rem; }
.bottom-nav__item i { font-size: 1.2rem; }
.bottom-nav__item.active { color: #fff; background: rgba(255,255,255,.1); }

.login-body { background: radial-gradient(circle at 80% 5%, rgba(79,169,154,.2), transparent 28%), var(--navy); }
.login-wrap { display: grid; min-height: calc(100vh - 2rem); place-items: center; }
.login-card { width: min(100%, 440px); }
.login-logo { border-radius: 24px; box-shadow: 0 12px 30px rgba(16,36,62,.18); }

.stats-filter { min-width: min(100%, 420px); }
.select2-container { min-width: 115px; }
.select2-container .select2-selection--single { height: 38px; border: 1px solid #dee2e6; border-radius: .375rem; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }

.period-tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: #e9edf1; border-radius: 14px; padding: .3rem; }
.period-tab { padding: .65rem; color: var(--muted); text-align: center; border-radius: 10px; font-size: .88rem; font-weight: 700; text-decoration: none; }
.period-tab.active { color: var(--navy); background: #fff; box-shadow: 0 3px 12px rgba(16,36,62,.08); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; }
.stat-card { min-height: 142px; padding: 1.2rem; display: flex; flex-direction: column; justify-content: center; background: #fff; border: 1px solid rgba(16,36,62,.05); border-radius: 18px; box-shadow: 0 8px 24px rgba(16,36,62,.06); }
.stat-card span { color: var(--muted); font-size: .8rem; }
.stat-card strong { color: var(--navy); font-size: 2rem; line-height: 1.3; }
.stat-card small { color: var(--muted); }
.stat-card--primary { background: var(--coral); border-color: var(--coral); }
.stat-card--primary span, .stat-card--primary strong, .stat-card--primary small { color: #fff; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.chart-wrap { position: relative; height: 300px; }

@media (max-width: 767.98px) {
    .hero-card { min-height: 140px; padding: 1.25rem; border-radius: 20px; }
    .hero-card h1 { font-size: 1.25rem; max-width: 200px; }
    .count-badge { min-width: 86px; height: 86px; }
    .action-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .chart-wrap { height: 260px; }
}

@media (max-width: 430px) {
    .stats-filter { display: grid !important; grid-template-columns: 1fr 1.35fr auto; }
    .stats-filter .select2-container { width: 100% !important; }
    .stats-filter .form-control { min-width: 0; }
}

@media (min-width: 768px) {
    .bottom-nav { position: sticky; bottom: 1rem; margin: 1.5rem auto 0; transform: none; left: auto; }
}
