* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

:root {
    --bg: #f3f7fb;
    --card: #ffffff;
    --primary: #0f766e;
    --primary-dark: #0b5f59;
    --secondary: #1d4ed8;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe4ee;
    --danger-soft: #fee2e2;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius: 20px;
}

body {
    background: var(--bg);
    color: var(--text);
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dff6f2, #eef4ff);
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 32px 24px;
    text-align: center;
}

.login-logo {
    width: 84px;
    height: 84px;
    object-fit: contain;
    margin-bottom: 14px;
}

.login-card h1 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 6px;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 18px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-form input,
.filter-card input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 15px;
    background: #fff;
    outline: none;
}

.login-form button,
.filter-card button {
    border: none;
    border-radius: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 14px;
}

.app-shell {
    min-height: 100vh;
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg);
    padding-bottom: 95px;
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(219,228,238,0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.header-left h2 {
    font-size: 18px;
    margin-bottom: 2px;
}

.header-left small,
.header-right span {
    color: var(--muted);
    font-size: 12px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.logout-btn {
    text-decoration: none;
    color: var(--secondary);
    font-size: 12px;
    font-weight: 700;
}

.content-area {
    padding: 16px;
}

.page-section {
    display: grid;
    gap: 18px;
}

.section-title-wrap h3 {
    font-size: 24px;
    margin-bottom: 4px;
}

.section-title-wrap p {
    color: var(--muted);
    font-size: 14px;
}

.circle-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.circle-card {
    background: linear-gradient(145deg, #ffffff, #edf7f8);
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    min-height: 150px;
    box-shadow: var(--shadow);
    border: 6px solid rgba(15,118,110,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px;
}

.circle-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.3;
    margin-bottom: 10px;
}

.circle-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    word-break: break-word;
}

.chart-card,
.filter-card,
.list-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.chart-card {
    overflow: hidden;
}

.card-heading {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 280px;
    min-height: 280px;
    max-height: 280px;
}

.donut-box {
    height: 320px;
    min-height: 320px;
    max-height: 320px;
}

.chart-box canvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.filter-card {
    display: grid;
    gap: 12px;
}

.card-list {
    display: grid;
    gap: 14px;
}

.card-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.card-row:last-child {
    border-bottom: none;
}

.card-row strong {
    color: var(--primary-dark);
    min-width: 120px;
}

.card-row span {
    text-align: right;
    flex: 1;
    word-break: break-word;
}

.danger-soft {
    background: var(--danger-soft);
    border: 1px solid #fecaca;
}

.empty-state {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    color: var(--muted);
    box-shadow: var(--shadow);
}

.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 496px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(219,228,238,0.9);
    border-radius: 26px;
    box-shadow: 0 18px 40px rgba(15,23,42,0.14);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 10px 8px;
    z-index: 50;
}

.nav-item {
    text-decoration: none;
    color: var(--muted);
    text-align: center;
    padding: 10px 6px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    transition: 0.2s ease;
}

.nav-item span {
    font-size: 20px;
}

.nav-item small {
    font-size: 12px;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 10px 24px rgba(29,78,216,0.24);
}

@media (max-width: 420px) {
    .circle-card {
        min-height: 136px;
    }

    .circle-label {
        font-size: 12px;
    }

    .circle-value {
        font-size: 18px;
    }

    .chart-box {
        height: 240px;
        min-height: 240px;
        max-height: 240px;
    }

    .donut-box {
        height: 300px;
        min-height: 300px;
        max-height: 300px;
    }

    .card-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-row span {
        text-align: left;
    }
}