:root {
    --bg: #edf4ef;
    --bg-soft: #e5efe8;
    --panel: rgba(232, 245, 236, 0.96);
    --panel-alt: #dff0e4;
    --border: #bdd3c2;
    --border-strong: #9fb7a6;
    --text: #173024;
    --muted: #5c7265;
    --primary: #04c52e;
    --primary-dark: #0a6b32;
    --primary-deep: #074922;
    --primary-soft: #e8f5ec;
    --accent: #39dd59;
    --success: #2d7a4c;
    --danger: #a33a3a;
    --shadow-sm: 0 10px 22px rgba(94, 173, 121, 0.12);
    --shadow-md: 0 18px 38px rgba(94, 173, 121, 0.16);
    --shadow-lg: 0 24px 52px rgba(94, 173, 121, 0.2);
    --edge-glow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 0 0 1px rgba(135, 185, 151, 0.24);
    --edge-glow-soft: 0 0 18px rgba(135, 185, 151, 0.14), 0 12px 28px rgba(94, 173, 121, 0.12);
    --edge-glow-strong: 0 0 26px rgba(135, 185, 151, 0.2), 0 16px 34px rgba(94, 173, 121, 0.16);
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(135, 185, 151, 0.12), transparent 20%),
        radial-gradient(circle at bottom right, rgba(220, 233, 223, 0.92), transparent 28%),
        linear-gradient(180deg, #f8fbf9 0%, var(--bg) 100%);
}

body.auth-page {
    background:
        radial-gradient(circle at top right, rgba(135, 185, 151, 0.1), transparent 18%),
        linear-gradient(180deg, #fafcfb 0%, #eaf1ec 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    max-width: 1340px;
    margin: 0 auto;
    padding: 28px 24px 42px;
}

.auth-page .app-shell {
    max-width: 1120px;
}

.topbar,
.nav,
.panel,
.metric-card,
.table-card,
.hero,
.detail-card,
.flash,
.auth-aside,
.auth-card {
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--edge-glow), var(--edge-glow-soft), var(--shadow-md);
    backdrop-filter: blur(10px);
}

.topbar {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 20px 34px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    background:
        linear-gradient(180deg, #0a6f34 0%, #03c92e 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.03));
    border-color: rgba(4, 150, 47, 0.44);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 26px rgba(3, 201, 46, 0.24), 0 18px 42px rgba(7, 73, 34, 0.28);
    color: white;
}

.topbar::before,
.topbar::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.topbar::before {
    width: 260px;
    height: 260px;
    top: -140px;
    right: -80px;
    background: radial-gradient(circle, rgba(67, 255, 118, 0.18), transparent 68%);
}

.topbar::after {
    width: 220px;
    height: 220px;
    bottom: -120px;
    left: -40px;
    background: radial-gradient(circle, rgba(154, 255, 183, 0.2), transparent 70%);
}

.auth-topbar {
    padding: 24px 28px;
    align-items: center;
    border-radius: 26px;
}

.topbar-main,
.topbar-copy {
    display: flex;
}

.topbar-main {
    flex-direction: row;
    gap: 16px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.topbar-branding {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.topbar-branding h1 {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.25;
}

.topbar-branding p {
    margin: 0;
    font-size: 0.75rem;
}

.topbar-copy {
    flex-direction: column;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    height: 84px;
    padding: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.36);
    box-shadow: 0 14px 28px rgba(7, 73, 34, 0.2);
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
}

.topbar h1,
.section-heading h2,
.hero h2,
.auth-aside h2 {
    margin: 0;
    font-family: "Georgia", "Palatino Linotype", serif;
    letter-spacing: -0.02em;
}

.topbar h1 {
    font-size: clamp(2.1rem, 3.9vw, 3.5rem);
    line-height: 1.02;
    color: #f7fff8;
}

.auth-topbar h1 {
    font-size: clamp(1.75rem, 3vw, 2.55rem);
    max-width: 12ch;
}
.topbar-meaning {
    margin: 8px 0 0;
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: rgba(247, 255, 248, 0.92);
}

.topbar-subtitle {
    margin: 12px 0 0;
    max-width: 60ch;
    color: rgba(247, 255, 248, 0.88);
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
}

.topbar .eyebrow {
    color: #baffc8;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: rgba(247, 255, 248, 0.92);
    font-size: 0.94rem;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.auth-topbar-meta {
    min-width: 230px;
}

.meta-pill,
.status-dot,
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(135, 185, 151, 0.2);
    background: linear-gradient(180deg, #f8fbf9 0%, #edf5ef 100%);
    color: var(--primary-dark);
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(94, 173, 121, 0.12);
}

.status-dot::before,
.user-chip::before,
.auth-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8fc9a2;
    box-shadow: 0 0 0 4px rgba(143, 201, 162, 0.16);
}


.topbar .meta-pill,
.topbar .status-dot,
.topbar .user-chip {
    border-color: rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.08) 100%);
    color: #f4fff5;
    box-shadow: 0 8px 18px rgba(7, 73, 34, 0.16);
}

.topbar .status-dot::before,
.topbar .user-chip::before {
    background: #8dffab;
    box-shadow: 0 0 0 4px rgba(141, 255, 171, 0.16);
}

.nav {
    margin-top: 18px;
    padding: 12px;
    border-radius: 22px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(247, 252, 248, 0.98), rgba(227, 242, 231, 0.96));
    border-color: rgba(4, 150, 47, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 20px rgba(3, 201, 46, 0.1), 0 14px 30px rgba(7, 73, 34, 0.14);
    position: sticky;
    top: 14px;
    z-index: 5;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    color: #5d7063;
    font-weight: 700;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-link:hover {
    transform: translateY(-1px);
    background: rgba(3, 201, 46, 0.08);
    color: #0a6b32;
}

.nav-link.active {
    background: linear-gradient(180deg, #0a6f34 0%, #03c92e 100%);
    color: #f7fff8;
    box-shadow: 0 12px 24px rgba(7, 73, 34, 0.24);
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.flash {
    margin-top: 18px;
    border-radius: var(--radius-md);
    padding: 15px 18px;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(238, 247, 241, 0.98) 0%, rgba(218, 235, 224, 0.98) 100%);
}

.flash-success {
    color: var(--success);
    border-color: rgba(45, 122, 76, 0.22);
}

.flash-error {
    color: var(--danger);
    border-color: rgba(163, 58, 58, 0.2);
}

.content {
    margin-top: 26px;
    display: grid;
    gap: 22px;
}

.auth-page .content {
    margin-top: 18px;
}

.hero {
    border-radius: var(--radius-lg);
    padding: 30px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 26px;
    background:
        linear-gradient(135deg, rgba(240, 251, 243, 0.98), rgba(220, 239, 227, 0.98)),
        linear-gradient(135deg, transparent, rgba(173, 214, 186, 0.56));
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -50px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 138, 103, 0.16), transparent 65%);
    pointer-events: none;
}

.hero p {
    margin: 10px 0 0;
    color: var(--muted);
    max-width: 62ch;
}

.quick-links {
    display: grid;
    gap: 12px;
    align-content: start;
}

.metrics-grid,
.two-column,
.three-column,
.detail-grid,
.auth-layout {
    display: grid;
    gap: 18px;
}

.metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-column {
    grid-template-columns: 1.05fr 1.95fr;
}

.three-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-grid {
    grid-template-columns: 1.2fr 1fr;
}

.auth-layout {
    grid-template-columns: 0.95fr 1.25fr;
    align-items: stretch;
}

.metric-card,
.panel,
.table-card,
.detail-card,
.auth-aside,
.auth-card {
    border-radius: 22px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.metric-card::before,
.panel::before,
.table-card::before,
.detail-card::before,
.auth-aside::before,
.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-dark), var(--accent));
    opacity: 0.95;
}

.metric-card {
    background: linear-gradient(180deg, #f2fbf4 0%, #dff1e5 100%);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.metric-card:hover,
.panel:hover,
.table-card:hover,
.detail-card:hover,
.auth-aside:hover,
.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--edge-glow), var(--edge-glow-strong), var(--shadow-lg);
}

.metric-label {
    margin: 0;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    font-weight: 700;
}

.metric-value {
    margin: 12px 0 4px;
    font-size: 2.35rem;
    line-height: 1;
    font-weight: 800;
    color: var(--primary-dark);
}

.metric-note,
.subtle,
.hint {
    color: var(--muted);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading h2 {
    font-size: 1.5rem;
    line-height: 1.15;
}

.section-heading p {
    margin: 8px 0 0;
    color: var(--muted);
}

form {
    margin: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    color: var(--text);
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(244, 251, 246, 0.96);
    color: var(--text);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
    color: #8aa092;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(135, 185, 151, 0.16);
    background: #ffffff;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.actions,
.inline-actions,
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.actions {
    margin-top: 18px;
}

.filters {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #f1faf3 0%, #dff1e5 100%);
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 15px;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.button:hover,
button:hover {
    transform: translateY(-1px);
}

.button:focus-visible,
button:focus-visible,
.nav-link:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(135, 185, 151, 0.16);
}

.button-primary,
button {
    background: linear-gradient(180deg, #0a6f34 0%, #03c92e 100%);
    color: #f8fbf2;
    border-color: rgba(4, 150, 47, 0.42);
    box-shadow: 0 12px 24px rgba(7, 73, 34, 0.24);
}

.button-primary:hover,
button:hover {
    box-shadow: 0 16px 30px rgba(7, 73, 34, 0.28);
}

.button-secondary {
    background: linear-gradient(180deg, #0a6f34 0%, #03c92e 100%);
    color: #f7fff8;
    border-color: rgba(4, 150, 47, 0.42);
    box-shadow: 0 12px 24px rgba(7, 73, 34, 0.22);
}

.topbar .button-secondary {
    background: linear-gradient(180deg, #0a6f34 0%, #03c92e 100%);
    color: #f7fff8;
    border-color: rgba(4, 150, 47, 0.42);
    box-shadow: 0 12px 24px rgba(7, 73, 34, 0.22);
}

.button-secondary:hover {
    background: linear-gradient(180deg, #0c7a39 0%, #12db3c 100%);
}

.topbar .button-secondary:hover {
    background: linear-gradient(180deg, #0c7a39 0%, #12db3c 100%);
}

.button-danger {
    background: #fff5f5;
    color: var(--danger);
    border-color: #f0d2d2;
}

.button-link {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
}

.button-link:hover {
    color: var(--primary-dark);
}

.inline-actions form {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

th,
td {
    text-align: left;
    padding: 14px 10px;
    vertical-align: top;
    border-bottom: 1px solid #e4ece6;
}

th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #dceee1;
}

tbody tr {
    transition: background 0.16s ease;
}

tbody tr:nth-child(even) {
    background: #e7f3ea;
}

tbody tr:hover {
    background: #d7eadc;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.stack {
    display: grid;
    gap: 18px;
}

.empty-state {
    padding: 22px;
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    background: linear-gradient(180deg, #edf7f0 0%, #d9ebe0 100%);
    color: var(--muted);
}

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

.summary-item {
    position: relative;
    padding: 16px 18px 16px 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #f3fbf5 0%, #e1f1e6 100%);
}

.summary-item::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary-dark), var(--accent));
}

.summary-item strong {
    display: block;
    margin-bottom: 6px;
}

.auth-aside {
    background:
        linear-gradient(160deg, rgba(241, 250, 244, 0.98), rgba(223, 240, 229, 0.98)),
        linear-gradient(180deg, transparent, rgba(173, 214, 186, 0.36));
    padding: 28px;
}

.auth-copy {
    margin-top: 16px;
    max-width: 34ch;
    color: var(--muted);
    font-size: 1rem;
}

.auth-meta-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.auth-card {
    min-height: 100%;
    padding: 28px;
}

.auth-actions {
    justify-content: flex-start;
}

.auth-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.auth-note strong {
    color: var(--primary-dark);
}

.topbar-meta .button {
    align-self: stretch;
}

@media (max-width: 1080px) {
    .metrics-grid,
    .three-column,
    .detail-grid,
    .two-column,
    .auth-layout,
    .hero {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
    }

    .topbar-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    color: rgba(247, 255, 248, 0.92);
    font-size: 0.94rem;
    position: relative;
    z-index: 1;
}

    .auth-topbar h1 {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 16px 14px 28px;
    }

    .topbar,
    .hero,
    .panel,
    .table-card,
    .detail-card,
    .metric-card,
    .auth-aside,
    .auth-card {
        padding: 20px;
    }

    .topbar-main {
        flex-direction: column;
    }

    .brand-mark {
        min-width: 64px;
        height: 64px;
    }


.nav {
        position: static;
    }

    .form-grid,
    .auth-meta-grid {
        grid-template-columns: 1fr;
    }
}