body {
    background:
        radial-gradient(circle at top left, rgba(31, 143, 95, 0.12), transparent 24%),
        linear-gradient(135deg, #eef4fb 0%, #f7f9fc 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #182039;
    transition: background 0.25s ease, color 0.25s ease;
}

body.theme-dark {
    background: linear-gradient(135deg, #09111d 0%, #101b2f 100%);
    color: #e5edf8;
}

body.theme-dark .card-soft,
body.theme-dark .dashboard-hero {
    background: rgba(11, 19, 34, 0.92);
    color: #e5edf8;
}

body.theme-dark .sidebar-card {
    background: linear-gradient(180deg, #08101d 0%, #0f1b31 100%);
    color: #eef4ff;
}

body.theme-dark .text-muted,
body.theme-dark .small,
body.theme-dark .sidebar-section-title {
    color: #9fb1ca !important;
}

body.theme-dark .table thead {
    background: #13223a;
    color: #e5edf8;
}

body.theme-dark .table tbody tr {
    color: #e5edf8;
}

body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark .list-group-item,
body.theme-dark .hero-status-box {
    background: #0f1a2d;
    color: #e5edf8;
    border-color: #20304a;
}

.theme-navbar {
    background: linear-gradient(135deg, #1f8f5f 0%, #176f49 100%);
    box-shadow: 0 8px 24px rgba(15, 95, 62, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-minimal {
    min-height: 62px;
    padding: 0.25rem 0;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-mark {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.8rem;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.28);
}

.dashboard-shell {
    max-width: 1600px;
    margin: 0 auto;
}

.dashboard-sidebar {
    position: relative;
    width: 100%;
}

.compact-nav-strip {
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-radius: 1rem;
}

.brand-pill {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.8rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1f8f5f, #2aa46b);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 8px 16px rgba(31, 143, 95, 0.22);
}

.simple-nav-link {
    text-decoration: none;
    color: #23415f;
    font-weight: 700;
    padding: 0.45rem 0.8rem;
    border-radius: 0.8rem;
    transition: all 0.2s ease;
}

.simple-nav-link:hover,
.simple-nav-link.active {
    background: #edf7f1;
    color: #126843;
}

.simple-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: #f2f6fb;
    color: #23415f;
    font-size: 0.83rem;
    font-weight: 700;
}

.simple-stat-pill.danger {
    background: #fff1f2;
    color: #b42318;
}

.simple-stat-pill.warning {
    background: #fff8e7;
    color: #9a6800;
}

.card-soft {
    border: 1px solid rgba(22, 51, 86, 0.06);
    border-radius: 1.35rem;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
}

.sidebar-card {
    padding: 0.9rem 1rem;
    position: sticky;
    top: 1rem;
    background: linear-gradient(180deg, #0f1726 0%, #111d33 100%);
    border: 1px solid rgba(160, 190, 255, 0.12);
    box-shadow: 0 12px 28px rgba(4, 10, 22, 0.28);
    transition: width 0.25s ease, padding 0.25s ease;
    color: #eef4ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

body.sidebar-collapsed .dashboard-sidebar {
    width: 6rem !important;
    flex: 0 0 6rem !important;
    max-width: 6rem !important;
}

body.sidebar-collapsed .sidebar-brand .sidebar-title,
body.sidebar-collapsed .sidebar-brand small,
body.sidebar-collapsed .sidebar-link span:not(.sidebar-link-icon),
body.sidebar-collapsed .sidebar-stat span,
body.sidebar-collapsed .sidebar-section-title {
    display: none;
}

body.sidebar-collapsed .sidebar-card {
    padding: 0.8rem 0.55rem;
}

body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-stat {
    justify-content: center;
}

body.sidebar-collapsed .sidebar-link i,
body.sidebar-collapsed .sidebar-stat i {
    margin: 0;
}

body.sidebar-collapsed .dashboard-main {
    width: calc(100% - 6rem);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0;
    border-radius: 0.95rem;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.22), rgba(31, 143, 95, 0.18));
    border: 1px solid rgba(148, 163, 184, 0.16);
    min-width: 220px;
}

.sidebar-brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2aa46b, #1f8f5f);
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 10px 20px rgba(20, 93, 65, 0.35);
}

.sidebar-title {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f8fbff;
}

.sidebar-section {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.status-strip {
    margin-left: auto;
}

.sidebar-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #98a8c5;
    margin-bottom: 0;
    margin-right: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.72rem 0.9rem;
    margin-bottom: 0;
    border-radius: 0.85rem;
    text-decoration: none;
    color: #dfe8f7;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.14);
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.02);
    min-width: 0;
}

.sidebar-link-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.8rem;
    display: grid;
    place-items: center;
    background: rgba(44, 151, 111, 0.18);
    color: #8bebbe;
    flex: 0 0 2.2rem;
}

.sidebar-link i {
    font-size: 1.05rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: linear-gradient(135deg, rgba(31, 143, 95, 0.24), rgba(31, 143, 95, 0.14));
    color: #f8fbff;
    border-color: rgba(99, 255, 184, 0.26);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.sidebar-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.58rem 0.72rem;
    border-radius: 0.85rem;
    background: rgba(255,255,255,0.04);
    margin-bottom: 0;
    font-size: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #eef4ff;
    min-width: 110px;
}

.sidebar-stat strong {
    font-size: 1.05rem;
}

.sidebar-stat.danger {
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.24);
    color: #ffd9de;
}

.sidebar-stat.warning {
    background: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.24);
    color: #ffe6a3;
}

.dashboard-hero {
    padding: 0.25rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(237,246,240,0.98));
    border: 1px solid rgba(31, 143, 95, 0.12);
}

.hero-icon {
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    color: #fff;
    background: linear-gradient(135deg, #1f8f5f, #2aa46b);
    box-shadow: 0 10px 24px rgba(31, 143, 95, 0.28);
}

.hero-status-box {
    min-width: 220px;
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    background: linear-gradient(135deg, #f4fbf7, #ffffff);
    border: 1px solid #d9efe1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 8px 18px rgba(20, 50, 80, 0.06);
}

.page-header {
    padding: 1.1rem 1.2rem;
    border-radius: 1.1rem;
}

.page-kicker {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: #eaf6ef;
    color: #1f8f5f;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.executive-kpi-grid .kpi-card {
    min-height: 144px;
    border: 1px solid rgba(22, 51, 86, 0.06);
    background: linear-gradient(135deg, #ffffff, #f7fbff);
}

.executive-kpi-grid .kpi-card .card-body {
    padding: 1.25rem 1.2rem;
}

.executive-kpi-grid h2 {
    font-size: 2rem;
    line-height: 1;
}

.executive-kpi-grid .warning-card {
    background: linear-gradient(135deg, #fffdf8, #fff9f0);
}

.executive-kpi-grid .alert-card {
    background: linear-gradient(135deg, #fffaf9, #fff3f2);
}

.stat-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 18px rgba(15, 23, 42, 0.12);
}

#map {
    height: 420px;
    border-radius: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.table thead {
    background: #f8fbff;
}

.table th,
.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(76, 130, 255, 0.08);
}

.badge-status {
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.history-filters .form-label {
    font-weight: 600;
}

.form-control,
.form-select {
    border-radius: 0.9rem;
    border: 1px solid #dbe7f1;
    padding: 0.78rem 0.95rem;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: #9ac8a8;
    box-shadow: 0 0 0 0.2rem rgba(31, 143, 95, 0.16);
}

.btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.auth-body {
    background:
        radial-gradient(circle at top left, rgba(33, 176, 108, 0.28), transparent 24%),
        linear-gradient(135deg, #0d3b2e 0%, #134b39 55%, #1b6c4c 100%);
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
}

.login-brand {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #ffffff;
    text-transform: uppercase;
}

.auth-card {
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.22);
}

.auth-badge {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: #eaf8f0;
    color: #1f8f5f;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.alert {
    border-radius: 1rem;
}

.premium-page {
    background:
        radial-gradient(circle at 8% 0%, rgba(31, 143, 95, 0.16), transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(37, 99, 235, 0.12), transparent 28%),
        linear-gradient(135deg, #eef4fb 0%, #f7f9fc 58%, #f1f7f4 100%);
    min-height: 100vh;
}

.premium-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding-top: 1.6rem;
    padding-bottom: 2.5rem;
}

.premium-page-hero {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 248, 244, 0.95)),
        linear-gradient(135deg, rgba(31, 143, 95, 0.08), rgba(37, 99, 235, 0.08));
}

.premium-page-hero h1 {
    font-size: clamp(1.5rem, 2.3vw, 2.2rem);
    letter-spacing: 0;
}

.premium-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .65rem;
    flex-wrap: wrap;
}

.premium-form-card .card-body,
.premium-detail-card .card-body {
    padding: 1.35rem;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: 1rem;
    color: #172033;
    font-weight: 800;
}

.form-section-title i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #12372a, #1f8f5f);
    box-shadow: 0 8px 16px rgba(31, 143, 95, .2);
}

.premium-form-card .form-label {
    color: #334155;
    font-weight: 700;
    margin-bottom: .45rem;
}

.premium-form-card .form-control,
.premium-form-card .form-select {
    background: #fbfdff;
    min-height: 48px;
}

.premium-form-card .form-control:hover,
.premium-form-card .form-select:hover {
    border-color: #b7cfdd;
}

.info-panel {
    height: 100%;
    border-radius: 1.25rem;
    padding: 1.2rem;
    background: linear-gradient(180deg, #10271f 0%, #12372a 100%);
    color: #eefdf5;
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .16);
}

.info-panel .text-muted {
    color: rgba(238, 253, 245, .72) !important;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.info-item i {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #8bebbe;
    background: rgba(255, 255, 255, .08);
    flex: 0 0 36px;
}

.detail-list {
    margin: 0;
}

.detail-list dt {
    color: #64748b;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .25rem;
}

.detail-list dd {
    margin-bottom: 1rem;
    color: #172033;
    font-weight: 700;
}

.reading-card {
    height: 100%;
    border-radius: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid rgba(15, 23, 42, .07);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .06);
}

.reading-card i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #1f8f5f, #2aa46b);
}

.reading-value {
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 800;
    color: #172033;
}

.empty-state-icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
    border-radius: 22px;
    color: #1f8f5f;
    background: #eaf6ef;
    font-size: 1.8rem;
}

@media (min-width: 992px) {
    .premium-form-card .card-body,
    .premium-detail-card .card-body {
        padding: 1.65rem;
    }
}

@media (max-width: 575.98px) {
    .premium-shell,
    .dashboard-shell {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .premium-actions {
        width: 100%;
        justify-content: stretch;
    }

    .premium-actions .btn {
        flex: 1 1 auto;
    }
}
