:root {
    --bg: #f4efe7;
    --surface: #fffdfa;
    --surface-2: #f6f1ea;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #decfbe;
    --brand: #a34a28;
    --brand-strong: #7f3419;
    --accent: #0f766e;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --success: #166534;
    --success-soft: #f0fdf4;
    --shadow: 0 20px 55px rgba(95, 63, 29, 0.11);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Manrope", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(163, 74, 40, 0.13), transparent 24%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.12), transparent 22%),
        var(--bg);
}

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

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.login-shell {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 24px;
}

.login-hero,
.login-card,
.panel-card,
.metric-card,
.sidebar-note {
    background: rgba(255, 253, 250, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(222, 207, 190, 0.9);
    box-shadow: var(--shadow);
}

.login-hero,
.login-card,
.panel-card {
    border-radius: 28px;
    padding: 28px;
}

.login-hero h1,
.topbar h1 {
    margin: 6px 0 12px;
    font-size: clamp(2rem, 2.8vw, 3.2rem);
    line-height: 1.04;
}

.login-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 52ch;
}

.hero-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.hero-grid article,
.metric-card {
    border-radius: 20px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 241, 234, 0.95));
    border: 1px solid var(--line);
}

.hero-grid span,
.metric-card span,
.eyebrow {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.hero-grid strong,
.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.12rem;
    line-height: 1.35;
}

.login-card h2,
.panel-card h2 {
    margin: 6px 0 18px;
    font-size: 1.45rem;
}

.stack-form,
.filter-grid {
    display: grid;
    gap: 16px;
}

.filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
}

.filter-grid .field-wide {
    grid-column: span 2;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    align-items: end;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 0.9rem;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--ink);
    padding: 14px 15px;
    font: inherit;
    outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(163, 74, 40, 0.12);
}

.field textarea {
    resize: vertical;
    min-height: 100px;
}

.field-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.field-check input {
    width: 18px;
    height: 18px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 12px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.button-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
}

.button-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
}

.button-block {
    width: 100%;
}

.flash {
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 0.95rem;
    font-weight: 700;
}

.flash-success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(22, 101, 52, 0.18);
}

.flash-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(180, 35, 24, 0.16);
}

.panel-shell {
    min-height: 100vh;
    position: relative;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(320px, calc(100vw - 32px));
    overflow-y: auto;
    padding: 22px;
    border-right: 1px solid rgba(222, 207, 190, 0.8);
    background: rgba(255, 250, 244, 0.86);
    backdrop-filter: blur(10px);
    box-shadow: 0 28px 60px rgba(95, 63, 29, 0.18);
    transform: translateX(calc(-100% - 24px));
    transition: transform 220ms ease;
}

body.drawer-open .sidebar {
    transform: translateX(0);
}

.sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
}

.brand small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.drawer-close,
.drawer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    cursor: pointer;
}

.drawer-close {
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 800;
}

.drawer-toggle {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 16px 32px rgba(95, 63, 29, 0.08);
}

.drawer-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    background: rgba(31, 41, 55, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

body.drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.nav-list {
    display: grid;
    gap: 8px;
}

.nav-group + .nav-group {
    margin-top: 18px;
}

.nav-heading {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.nav-list a {
    padding: 13px 14px;
    border-radius: 16px;
    font-weight: 700;
    color: #4b5563;
}

.nav-list a.active,
.nav-list a:hover {
    background: #fff;
    color: var(--brand-strong);
    box-shadow: 0 10px 24px rgba(95, 63, 29, 0.08);
}

.sidebar-note {
    margin-top: 24px;
    padding: 18px;
    border-radius: 22px;
}

.sidebar-note strong {
    display: block;
    margin: 10px 0 8px;
    overflow-wrap: anywhere;
}

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

.content-shell {
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.topbar-leading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    text-align: right;
}

.user-chip strong {
    display: block;
}

.user-chip small {
    color: var(--muted);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metric-card strong {
    margin: 12px 0 8px;
    font-size: 2rem;
}

.metric-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.panel-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
}

.panel-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.page-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.stack-text {
    display: grid;
    gap: 14px;
}

.panel-note {
    border-radius: 18px;
    border: 1px dashed var(--line);
    background: rgba(246, 241, 234, 0.88);
    padding: 14px 16px;
    color: #5b4330;
    line-height: 1.65;
}

.quick-link-grid,
.form-grid,
.definition-grid {
    display: grid;
    gap: 16px;
}

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

.package-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.package-card,
.package-section {
    scroll-margin-top: 24px;
}

.package-card {
    display: grid;
    gap: 16px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 241, 234, 0.96));
    padding: 22px;
    box-shadow: 0 18px 42px rgba(95, 63, 29, 0.1);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.package-card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 118, 110, 0.34);
    box-shadow: 0 24px 48px rgba(95, 63, 29, 0.15);
}

.package-card-top,
.package-map-header,
.package-customers-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.package-card-top h3 {
    margin: 8px 0 0;
    font-size: 1.28rem;
    line-height: 1.24;
}

.package-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.package-meta-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    font-size: 0.86rem;
    font-weight: 800;
}

.package-card-metrics,
.package-profile-grid {
    display: grid;
    gap: 14px;
}

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

.package-card-actions {
    display: flex;
    justify-content: flex-end;
}

.package-card-metrics div,
.package-profile-grid div {
    border-radius: 18px;
    border: 1px solid rgba(222, 207, 190, 0.82);
    background: rgba(255, 255, 255, 0.72);
    padding: 14px 15px;
}

.package-card-metrics span,
.package-profile-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.77rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.package-card-metrics strong,
.package-profile-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 1rem;
    line-height: 1.45;
}

.package-profile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
}

.package-map-shell {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.package-map {
    min-height: 340px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 20%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 241, 234, 0.96));
}

.package-map-empty {
    display: grid;
    place-items: center;
}

.package-map-empty-text {
    color: var(--muted);
    font-weight: 700;
    text-align: center;
    padding: 20px;
}

.package-table td,
.package-table th {
    white-space: normal;
    min-width: 140px;
}

.package-address-cell {
    min-width: 260px;
}

.investor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.investor-card,
.empty-state-card {
    border-radius: 26px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 241, 234, 0.96));
    box-shadow: 0 18px 42px rgba(95, 63, 29, 0.1);
}

.investor-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.investor-card:hover {
    transform: translateY(-4px);
    border-color: rgba(163, 74, 40, 0.34);
    box-shadow: 0 24px 48px rgba(95, 63, 29, 0.16);
}

.investor-card-top,
.investor-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.investor-card-top h3 {
    margin: 8px 0 0;
    font-size: 1.28rem;
    line-height: 1.25;
}

.investor-metrics,
.investor-split {
    display: grid;
    gap: 12px;
}

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

.investor-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}

.investor-metrics div,
.investor-split div {
    border-radius: 18px;
    border: 1px solid rgba(222, 207, 190, 0.8);
    background: rgba(255, 255, 255, 0.72);
    padding: 14px 15px;
}

.investor-metrics span,
.investor-split span {
    display: block;
    color: var(--muted);
    font-size: 0.77rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.investor-metrics strong,
.investor-split strong {
    display: block;
    margin-top: 8px;
    font-size: 1.02rem;
    line-height: 1.45;
}

.investor-card-footer {
    padding-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.empty-state-card {
    padding: 24px;
    color: var(--muted);
}

.quick-link-card {
    display: block;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 241, 234, 0.96));
    padding: 18px;
    box-shadow: 0 14px 35px rgba(95, 63, 29, 0.08);
}

.quick-link-card strong {
    display: block;
    margin-bottom: 8px;
}

.quick-link-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

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

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

.definition-grid div {
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    padding: 14px 16px;
}

.definition-grid span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.definition-grid strong {
    display: block;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

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

.definition-wide {
    grid-column: span 3;
}

.metric-inline {
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(246, 241, 234, 0.95);
    border: 1px solid var(--line);
    font-weight: 800;
}

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

.form-section {
    display: grid;
    gap: 16px;
    padding-top: 8px;
    border-top: 1px solid rgba(222, 207, 190, 0.8);
}

.form-section + .form-section {
    margin-top: 4px;
}

.form-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.form-section h3 {
    margin: 6px 0 0;
    font-size: 1.05rem;
}

.field-note {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(222, 207, 190, 0.72);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.table th {
    font-size: 0.76rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: #efe5d8;
    color: var(--brand-strong);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.status-paid,
.status-selesai,
.status-aktif,
.status-terbuka {
    background: #e8f7ef;
    color: #166534;
}

.status-pending,
.status-progress {
    background: #fff3cd;
    color: #9a6700;
}

.status-fail,
.status-expired,
.status-tutup,
.status-isolir,
.status-nonaktif {
    background: #fde7e7;
    color: #b42318;
}

.empty-state {
    color: var(--muted);
    white-space: normal;
}

.pagination-bar {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.pagination-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 1100px) {
    .login-shell,
    .panel-grid,
    .card-grid,
    .filter-grid,
    .package-card-grid,
    .package-profile-grid,
    .package-card-metrics,
    .investor-grid,
    .quick-link-grid,
    .form-grid,
    .definition-grid,
    .definition-grid-compact {
        grid-template-columns: 1fr;
    }

    .filter-grid .field-wide {
        grid-column: span 1;
    }

    .definition-wide {
        grid-column: span 1;
    }
}

@media (max-width: 860px) {
    .content-shell {
        padding: 22px 16px 24px;
    }

    .sidebar {
        width: min(320px, calc(100vw - 20px));
    }

    .package-card-top,
    .package-map-header,
    .package-customers-head,
    .topbar,
    .panel-card-head,
    .pagination-bar {
        flex-direction: column;
    }

    .topbar-leading,
    .topbar-actions,
    .filter-actions,
    .investor-card-top,
    .investor-card-footer,
    .investor-split {
        width: 100%;
        justify-content: flex-start;
    }

    .topbar-actions {
        align-items: flex-start;
    }

    .drawer-close {
        padding-inline: 12px;
    }
}
