:root {
    --bg-main: #f8fbff;
    --bg-main-accent: #eef3f9;
    --bg-card: #ffffff;
    --bg-card-soft: #f8fbff;
    --bg-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --bg-hero-card: rgba(255, 255, 255, 0.08);
    --text-main: #122033;
    --text-hero: #ffffff;
    --text-muted: #516173;
    --text-soft: #64748b;
    --text-hero-muted: #c7d2e1;
    --border: #e7edf5;
    --border-soft: #d9e3ef;
    --primary: #0284c7;
    --primary-strong: #0369a1;
    --progress-bg: #e7edf5;
    --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 18px 40px rgba(15, 23, 42, 0.18);
    --status-normal-bg: #dcfce7;
    --status-normal-text: #166534;
    --status-low-bg: #fef3c7;
    --status-low-text: #92400e;
    --status-critical-bg: #fee2e2;
    --status-critical-text: #991b1b;
    --hero-eyebrow: #7dd3fc;
}

[data-theme="dark"] {
    --bg-main: #0b1120;
    --bg-main-accent: #111827;
    --bg-card: #162033;
    --bg-card-soft: #1b263b;
    --bg-hero: linear-gradient(135deg, #020617 0%, #111827 100%);
    --bg-hero-card: rgba(255, 255, 255, 0.06);
    --text-main: #e2e8f0;
    --text-hero: #f8fafc;
    --text-muted: #94a3b8;
    --text-soft: #a8b3c5;
    --text-hero-muted: #cbd5e1;
    --border: #334155;
    --border-soft: #3b475c;
    --primary: #38bdf8;
    --primary-strong: #0ea5e9;
    --progress-bg: #243244;
    --shadow: 0 12px 28px rgba(2, 6, 23, 0.35);
    --shadow-strong: 0 18px 40px rgba(2, 6, 23, 0.45);
    --status-normal-bg: rgba(34, 197, 94, 0.18);
    --status-normal-text: #86efac;
    --status-low-bg: rgba(245, 158, 11, 0.18);
    --status-low-text: #fcd34d;
    --status-critical-bg: rgba(239, 68, 68, 0.18);
    --status-critical-text: #fca5a5;
    --hero-eyebrow: #7dd3fc;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg-main);
}

body.dashboard-body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 28%),
        linear-gradient(180deg, var(--bg-main) 0%, var(--bg-main-accent) 100%);
    color: var(--text-main);
    transition: background 0.2s ease, color 0.2s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

strong {
    font-weight: 700;
}

.page-shell {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 30px;
}

.page-shell-narrow {
    max-width: 980px;
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: stretch;
    background: var(--bg-hero);
    color: var(--text-hero);
    border-radius: 26px;
    padding: 30px;
    box-shadow: var(--shadow-strong);
    margin-bottom: 32px;
    position: relative;
}

.hero-panel-centered {
    justify-content: center;
    align-items: center;
    min-height: 280px;
    padding: 38px 30px 34px;
}

.hero-top-actions {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    z-index: 2;
}

.hero-brand-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-logo {
    width: 180px;
    max-width: 100%;
    height: auto;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 12px;
}

.hero-logo-centered {
    width: min(78vw, 340px);
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.hero-text {
    text-align: center;
}

.hero-text h1,
.subpage-header h1 {
    margin: 6px 0 10px 0;
    font-size: 40px;
    line-height: 1.1;
}

.hero-text p,
.subpage-header p {
    margin: 0;
    color: var(--text-hero-muted);
    max-width: 760px;
    line-height: 1.6;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 1.6px;
    font-weight: 700;
    color: var(--hero-eyebrow);
}

.main-header {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
    background: var(--bg-hero);
    color: var(--text-hero);
    border-radius: 26px;
    padding: 34px 24px 28px;
    box-shadow: var(--shadow-strong);
}

.header-top-right {
    position: absolute;
    top: 22px;
    right: 22px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.main-logo {
    width: min(78vw, 320px);
    max-height: 120px;
    object-fit: contain;
    height: auto;
}

.main-title {
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 800;
    margin: 0;
    line-height: 1.08;
}

.sub-title {
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 700;
    margin: 0;
    color: var(--text-hero);
}

.sub-description {
    font-size: 14px;
    color: var(--text-hero-muted);
    margin: 4px 0 0;
    max-width: 780px;
    line-height: 1.5;
}

.section-header {
    margin-bottom: 18px;
}

.section-header h2 {
    margin: 0 0 6px 0;
    font-size: 28px;
}

.section-header p {
    margin: 0;
    color: var(--text-muted);
}

.section-header-centered {
    text-align: center;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 22px;
}

.app-grid-dashboard {
    align-items: stretch;
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--text-main);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
    border-color: var(--primary);
}

.app-card-centered {
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 220px;
}

.app-icon {
    font-size: 48px;
    line-height: 1;
}

.app-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.app-link-text {
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
}

.form-panel,
.subpage-header,
.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.subpage-header {
    padding: 26px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    background: var(--bg-hero);
    color: var(--text-hero);
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.form-panel {
    padding: 24px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
}

.tank-form,
.standard-form {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--bg-card-soft);
    color: var(--text-main);
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(2, 132, 199, 0.22);
}

.btn-secondary {
    background: var(--bg-card-soft);
    color: var(--text-main);
    border-color: var(--border-soft);
}

.btn-small {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 13px;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.data-table thead th {
    background: var(--bg-card-soft);
    color: var(--text-main);
    text-align: left;
    font-size: 13px;
    font-weight: 800;
    padding: 14px 14px;
    border-bottom: 1px solid var(--border);
}

.data-table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 14px;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.status-normal {
    background: var(--status-normal-bg);
    color: var(--status-normal-text);
}

.status-low {
    background: var(--status-low-bg);
    color: var(--status-low-text);
}

.status-critical {
    background: var(--status-critical-bg);
    color: var(--status-critical-text);
}

.demo-message {
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text-main);
}

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top left, rgba(62, 114, 255, 0.10), transparent 28%),
        radial-gradient(circle at top right, rgba(0, 200, 180, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(8, 18, 34, 0.98), rgba(13, 24, 42, 0.98));
    position: relative;
    overflow: hidden;
}

body.light-mode .login-page {
    background:
        radial-gradient(circle at top left, rgba(62, 114, 255, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(0, 200, 180, 0.06), transparent 24%),
        linear-gradient(180deg, #f4f7fb, #edf2f8);
}

.login-topbar {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 22px 28px 0;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.login-brand-wrap {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 24px 0;
    text-align: center;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.login-logo {
    display: block;
    max-width: 460px;
    width: min(78vw, 460px);
    height: auto;
    margin: 8px auto 18px;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.22));
}

body.light-mode .login-logo {
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.12));
}

.login-site-title {
    margin: 0;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #ffffff;
}

body.light-mode .login-site-title {
    color: #10233d;
}

.login-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px 24px 48px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.login-card {
    width: 100%;
    max-width: 460px;
    border-radius: 24px;
    padding: 30px 28px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.light-mode .login-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(16, 35, 61, 0.08);
    box-shadow: 0 16px 40px rgba(16, 35, 61, 0.10);
}

.login-form-title {
    margin: 0 0 22px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

body.light-mode .login-form-title {
    color: #10233d;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-form label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.90);
}

body.light-mode .login-form label {
    color: #20324a;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 12px 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-form input[type="text"]::placeholder,
.login-form input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.58);
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    border-color: rgba(117, 160, 255, 0.85);
    box-shadow: 0 0 0 4px rgba(77, 124, 254, 0.14);
    background: rgba(255, 255, 255, 0.16);
}

body.light-mode .login-form input[type="text"],
body.light-mode .login-form input[type="password"] {
    border: 1px solid rgba(16, 35, 61, 0.12);
    background: #ffffff;
    color: #10233d;
}

body.light-mode .login-form input[type="text"]::placeholder,
body.light-mode .login-form input[type="password"]::placeholder {
    color: rgba(16, 35, 61, 0.42);
}

body.light-mode .login-form input[type="text"]:focus,
body.light-mode .login-form input[type="password"]:focus {
    border-color: rgba(77, 124, 254, 0.72);
    box-shadow: 0 0 0 4px rgba(77, 124, 254, 0.12);
    background: #ffffff;
}

.login-submit {
    margin-top: 4px;
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #ffffff;
    background: linear-gradient(135deg, #2d6bff, #1f56db);
    box-shadow: 0 12px 26px rgba(45, 107, 255, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
}

.login-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    color: #fff3f3;
    background: rgba(190, 38, 38, 0.22);
    border: 1px solid rgba(255, 130, 130, 0.22);
}

body.light-mode .login-error {
    color: #7b1d1d;
    background: #fff1f1;
    border: 1px solid #f1c4c4;
}

.print-only {
    display: none;
}

.no-print {
    display: block;
}

@media (max-width: 960px) {
    .page-shell {
        padding: 18px;
    }

    .hero-panel,
    .subpage-header,
    .main-header {
        border-radius: 22px;
    }

    .hero-top-actions,
    .header-top-right {
        position: static;
        margin-bottom: 18px;
        justify-content: center;
    }

    .hero-panel,
    .subpage-header {
        flex-direction: column;
    }

    .header-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 14px;
    }

    .hero-panel,
    .form-panel,
    .subpage-header,
    .summary-card,
    .main-header,
    .login-card {
        padding: 18px;
    }

    .hero-logo-centered,
    .main-logo {
        width: min(82vw, 260px);
    }

    .hero-text h1,
    .subpage-header h1,
    .main-title,
    .login-site-title {
        font-size: 30px;
    }

    .sub-title {
        font-size: 20px;
    }

    .app-card-centered {
        min-height: 180px;
    }

    .login-topbar {
        padding: 16px 16px 0;
    }

    .login-brand-wrap {
        padding: 8px 16px 0;
    }
}

@media print {
    .print-only {
        display: block !important;
    }

    .no-print {
        display: none !important;
    }
}