/* ==========================================================================
   Sistem desain Flip7, dialihkan ke web.
   Satuan asli rpx milik WeChat diganti px: 1rpx = 0.5px pada layar 375pt.
   Dua penyimpangan yang disengaja, alasannya ada di DESIGN.md:
   - target sentuh minimum 44px, bukan 36px (72rpx), mengikuti WCAG 2.5.8;
   - skala huruf dinaikkan sedikit supaya nyaman dibaca di layar desktop.
   ========================================================================== */

:root {
    /* Warna inti */
    --teal: #2BA8A2;
    --teal-light: #3CC4BD;
    --teal-dark: #1E8C86;
    --teal-bg: #E8F6F5;

    --gold: #FFD23F;
    --gold-light: #FFE47A;
    --gold-dark: #E6B800;

    --coral: #EF6C4A;
    --coral-light: #FF8A6A;
    --coral-dark: #D45233;

    --cream: #FFF8E7;
    --sky: #5DADE2;

    --surface: #EFF8F7;
    --surface-card: #FFFFFF;
    --ink: #1E8C86;
    --ink-soft: #5B8A88;
    --ink-dark: #163F3D;
    --line: #D9EBEA;

    --success: #27AE60;
    --error: #E74C3C;

    /* Jarak, dasar 8px */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;

    /* Sudut */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-round: 999px;

    /* Bayangan: bayangan hitam datar untuk permukaan, bayangan berwarna untuk elemen interaktif */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .16);
    --shadow-card: 0 4px 20px rgba(43, 168, 162, .10);
    --shadow-teal-glow: 0 4px 20px rgba(43, 168, 162, .30);
    --shadow-gold-glow: 0 4px 20px rgba(255, 210, 63, .40);
    --shadow-coral-glow: 0 4px 20px rgba(239, 108, 74, .35);
    --shadow-sky-glow: 0 4px 16px rgba(93, 173, 226, .30);
    --shadow-focus: 0 0 0 4px rgba(43, 168, 162, .22);

    --bounce: cubic-bezier(.34, 1.56, .64, 1);
    --tap: 44px;

    --sidebar-w: 268px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Dasar
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-dark);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin: 0 0 var(--space-xs);
    line-height: 1.25;
    color: var(--teal-dark);
}

h1 { font-size: clamp(24px, 4vw, 30px); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: clamp(20px, 3vw, 23px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }

p { margin: 0 0 var(--space-sm); }

a {
    color: var(--coral-dark);
    font-weight: 600;
    text-decoration: none;
}

a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--space-sm);
    top: -200px;
    z-index: 200;
    padding: 12px 20px;
    background: var(--gold);
    color: var(--ink-dark);
    border-radius: var(--radius-round);
    font-weight: 800;
    transition: top .2s ease;
}

.skip-link:focus { top: var(--space-sm); }

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.stack > * + * { margin-top: var(--space-md); }

.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.strong { font-weight: 800; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.sci { font-style: italic; }

/* --------------------------------------------------------------------------
   Lencana merek, menyadur logo Flip7: teks di dalam jajar genjang krem
   -------------------------------------------------------------------------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    font-size: 24px;
    background: var(--cream);
    border: 3px solid var(--teal-dark);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-teal-glow);
    overflow: hidden;
}

.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.brand-text { min-width: 0; }

.brand-name {
    display: block;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--teal-dark);
    line-height: 1.2;
}

.brand-sub {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
}

.wordmark {
    display: inline-block;
    padding: 6px 18px;
    background: var(--cream);
    border: 3px solid var(--teal-dark);
    border-radius: var(--radius-sm);
    transform: skewX(-6deg);
    box-shadow: var(--shadow-sm);
}

.wordmark > span {
    display: inline-block;
    transform: skewX(6deg);
    font-weight: 800;
    letter-spacing: .04em;
    color: var(--teal-dark);
}

.ribbon {
    position: relative;

    /* z-index: 0 membuat konteks penumpukan sendiri. Tanpa ini, ekor pita yang
       ber-z-index -1 lolos ke konteks akar dan tersembunyi di belakang latar kartu. */
    z-index: 0;

    /* display: table bersifat block-level tapi lebarnya mengikuti isi, jadi pita
       selalu mulai baris baru dan tetap selebar teksnya. */
    display: table;
    margin: 14px auto 0;
    padding: 6px 22px;
    background: var(--cream);
    border: 3px solid var(--teal-dark);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--teal-dark);
}

.ribbon::before,
.ribbon::after {
    content: "";
    position: absolute;

    /* Digeser turun 8px untuk kesan lipatan. Tingginya ditentukan pasangan
       top dan bottom, bukan height persen: larangan ke-12 Flip7. */
    top: 8px;
    bottom: -8px;
    width: 22px;
    background: #F2E7C9;
    border: 3px solid var(--teal-dark);
    border-radius: var(--radius-sm);
    z-index: -1;
}

.ribbon::before { left: -14px; }
.ribbon::after { right: -14px; }

/* --------------------------------------------------------------------------
   Tombol
   -------------------------------------------------------------------------- */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-height: var(--tap);
    padding: 11px 24px;
    border: 0;
    border-radius: var(--radius-round);
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: transform .18s var(--bounce), box-shadow .18s ease, background-color .18s ease;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.95); }

.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

/* Tombol utama: gradien emas dengan lapisan kilap */
.btn-primary {
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 55%, var(--gold-dark) 100%);
    color: var(--ink-dark);
    box-shadow: var(--shadow-gold-glow);
}

.btn-primary::before {
    content: "";
    position: absolute;
    inset: 2px 2px 50% 2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
    border-radius: var(--radius-round);
    pointer-events: none;
}

.btn-primary:hover { background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%); }

.btn-teal {
    background: var(--teal);
    color: #fff;
    box-shadow: var(--shadow-teal-glow);
}

.btn-teal:hover { background: var(--teal-dark); }

.btn-coral {
    background: var(--coral);
    color: #fff;
    box-shadow: var(--shadow-coral-glow);
}

.btn-coral:hover { background: var(--coral-dark); }

.btn-ghost {
    background: var(--surface-card);
    color: var(--teal-dark);
    box-shadow: inset 0 0 0 2px var(--line), var(--shadow-sm);
}

.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--teal-light), var(--shadow-card); }

.btn-sm {
    min-height: 36px;
    padding: 7px 16px;
    font-size: 13.5px;
}

.btn-block { width: 100%; }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    align-items: center;
}

/* Tombol ikon persegi membulat, seperti tombol +/- Flip7 */
.btn-icon {
    width: var(--tap);
    min-height: var(--tap);
    padding: 0;
    border-radius: var(--radius-md);
    font-size: 17px;
}

/* --------------------------------------------------------------------------
   Kartu
   -------------------------------------------------------------------------- */

.card {
    position: relative;
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-md);
    overflow: hidden;
}

.card-pad-lg { padding: var(--space-lg); }

/* Batang warna di sisi kiri menyampaikan kategori atau status */
.card-accent::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--teal-light);
}

.card-accent { padding-left: calc(var(--space-md) + 6px); }
.tone-teal.card-accent::before { background: var(--teal); }
.tone-gold.card-accent::before { background: var(--gold); }
.tone-coral.card-accent::before { background: var(--coral); }
.tone-sky.card-accent::before { background: var(--sky); }

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

/* Judul bagian: emoji dalam kotak sendiri, garis bawah putus-putus */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 var(--space-md);
    padding-bottom: 12px;
    border-bottom: 3px dashed var(--line);
}

.section-title .icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    font-size: 19px;
    background: var(--teal-bg);
    border-radius: var(--radius-sm);
}

.section-title h2,
.section-title h3 { margin: 0; }

/* --------------------------------------------------------------------------
   Lencana dan pil
   -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-round);
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-teal { background: var(--teal-bg); color: var(--teal-dark); }
.badge-gold { background: var(--gold-light); color: #7A5C00; }
.badge-coral { background: #FDE3DC; color: var(--coral-dark); }
.badge-sky { background: #E3F1FB; color: #1F6FA8; }
.badge-solid-teal { background: var(--teal); color: #fff; }

/* --------------------------------------------------------------------------
   Formulir
   -------------------------------------------------------------------------- */

.field { margin-bottom: var(--space-md); }

.field > label,
.field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 800;
    color: var(--teal-dark);
}

.field-hint {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.field-error {
    margin: 6px 0 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--error);
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: var(--tap);
    padding: 11px 14px;
    font: inherit;
    font-size: 15px;
    color: var(--ink-dark);
    background: var(--cream);
    border: 2px solid var(--line);
    border-radius: var(--radius-md);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.select {
    appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231E8C86' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--teal);
    box-shadow: var(--shadow-focus);
    outline: none;
}

.input.has-error,
.select.has-error,
.textarea.has-error { border-color: var(--error); }

.input[type="file"] {
    padding: 9px 12px;
    background: var(--surface-card);
    cursor: pointer;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: var(--tap);
    padding: 10px 14px;
    background: var(--cream);
    border: 2px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 600;
}

.checkbox input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--teal); flex: 0 0 18px; }

.grid-2,
.grid-3,
.grid-4 { display: grid; gap: var(--space-md); }

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* --------------------------------------------------------------------------
   Pemberitahuan
   -------------------------------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14.5px;
    border-left: 6px solid transparent;
}

.alert-success { background: #E6F7EE; border-left-color: var(--success); color: #16703D; }
.alert-error { background: #FDE3DC; border-left-color: var(--coral); color: var(--coral-dark); }
.alert-info { background: var(--teal-bg); border-left-color: var(--teal); color: var(--teal-dark); }

/* --------------------------------------------------------------------------
   Petak statistik
   -------------------------------------------------------------------------- */

.stat {
    position: relative;
    padding: var(--space-md);
    padding-left: calc(var(--space-md) + 6px);
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--teal-light);
}

.stat.tone-teal::before { background: var(--teal); }
.stat.tone-gold::before { background: var(--gold); }
.stat.tone-coral::before { background: var(--coral); }
.stat.tone-sky::before { background: var(--sky); }

.stat-head {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-soft);
}

.stat-value {
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 800;
    line-height: 1.1;
    color: var(--teal-dark);
}

.stat-note { font-size: 12.5px; color: var(--ink-soft); }

/* Diagram batang kunjungan, murni CSS */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 160px;
    padding-top: var(--space-sm);
}

.chart-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.chart-bar {
    width: 100%;
    min-height: 4px;
    background: linear-gradient(180deg, var(--teal-light), var(--teal));
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: filter .18s ease;
}

.chart-col:hover .chart-bar { filter: brightness(1.08); }
.chart-col.is-today .chart-bar { background: linear-gradient(180deg, var(--gold-light), var(--gold-dark)); }

.chart-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ink-soft);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Tabel
   -------------------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

.table th,
.table td {
    padding: 13px var(--space-sm);
    text-align: left;
    vertical-align: middle;
    border-bottom: 2px solid var(--surface);
}

.table th {
    font-size: 12.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-soft);
    background: var(--teal-bg);
    white-space: nowrap;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFDFD; }
.table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-tight { width: 1%; white-space: nowrap; }

.thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--teal-bg);
}

.thumb-empty {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--teal-bg);
    font-size: 20px;
}

/* --------------------------------------------------------------------------
   Daftar tanaman publik
   -------------------------------------------------------------------------- */

.plant-grid {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}

.plant-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .2s var(--bounce), box-shadow .2s ease;
}

.plant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-teal-glow);
    text-decoration: none;
}

.plant-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--teal-bg);
    display: grid;
    place-items: center;
    font-size: 44px;
}

.plant-card-media img { width: 100%; height: 100%; object-fit: cover; }

.plant-card-media .badge {
    position: absolute;
    left: 12px;
    top: 12px;
    box-shadow: var(--shadow-sm);
}

.plant-card-body {
    flex: 1;
    padding: var(--space-sm);
    border-top: 3px dashed var(--line);
}

.plant-card-name {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 800;
    color: var(--teal-dark);
}

.plant-card-sci {
    margin: 0 0 8px;
    font-size: 13.5px;
    font-style: italic;
    color: var(--ink-soft);
}

.plant-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-soft);
}

.empty-state {
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.empty-state .emoji { font-size: 48px; margin-bottom: var(--space-xs); }

/* --------------------------------------------------------------------------
   Penomoran halaman
   -------------------------------------------------------------------------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: var(--space-lg);
}

.pagination a,
.pagination span {
    display: grid;
    place-items: center;
    min-width: var(--tap);
    min-height: var(--tap);
    padding: 0 12px;
    border-radius: var(--radius-md);
    font-size: 14.5px;
    font-weight: 800;
    text-decoration: none;
    color: var(--teal-dark);
    background: var(--surface-card);
    box-shadow: var(--shadow-sm);
}

.pagination a:hover { background: var(--teal-bg); text-decoration: none; }

.pagination .is-current {
    background: var(--teal);
    color: #fff;
    box-shadow: var(--shadow-teal-glow);
}

.pagination .is-disabled { opacity: .4; }

/* --------------------------------------------------------------------------
   Tata letak publik
   -------------------------------------------------------------------------- */

.public-header {
    background: var(--surface-card);
    border-bottom: 3px solid var(--teal-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 30;
}

.public-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: 76px;
    padding: 12px var(--space-md);
}

.public-hero {
    background: linear-gradient(160deg, var(--teal-dark) 0%, var(--teal) 70%, var(--teal-light) 100%);
    color: #fff;
    padding: var(--space-xl) 0;
    text-align: center;
}

.public-hero h1 { color: #fff; }
.public-hero p { color: rgba(255, 255, 255, .88); max-width: 620px; margin: 0 auto; }

.public-main { padding: var(--space-lg) 0 var(--space-xl); }

.public-footer {
    padding: var(--space-lg) 0;
    background: var(--teal-dark);
    color: rgba(255, 255, 255, .85);
    font-size: 14px;
    text-align: center;
}

.public-footer a { color: var(--gold); }

/* Kotak pencarian besar di hero */
.search-bar {
    display: flex;
    gap: var(--space-xs);
    max-width: 640px;
    margin: var(--space-md) auto 0;
    padding: var(--space-xs);
    background: var(--surface-card);
    border-radius: var(--radius-round);
    box-shadow: var(--shadow-lg);
}

.search-bar .input {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.search-bar .input:focus { box-shadow: none; }

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    justify-content: center;
    margin-top: var(--space-md);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 16px;
    border-radius: var(--radius-round);
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, .34);
    transition: transform .18s var(--bounce);
}

.chip:hover { text-decoration: none; transform: translateY(-2px); }

.chip.is-active {
    background: var(--gold);
    color: var(--ink-dark);
    border-color: var(--gold-dark);
    box-shadow: var(--shadow-gold-glow);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   Halaman detail tanaman
   -------------------------------------------------------------------------- */

.detail {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 880px) {
    .detail { grid-template-columns: 420px minmax(0, 1fr); align-items: start; }
}

.detail-photo {
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--teal-bg);
    box-shadow: var(--shadow-card);
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    font-size: 72px;
}

.detail-photo img { width: 100%; height: 100%; object-fit: cover; }

.fact-list {
    display: grid;
    gap: var(--space-xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 12px var(--space-sm);
    background: var(--cream);
    border-radius: var(--radius-md);
}

.fact dt, .fact-key {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-soft);
}

.fact dd, .fact-val { margin: 0; font-weight: 700; color: var(--teal-dark); }

.prose { font-size: 16px; line-height: 1.75; }
.prose p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Tata letak admin
   -------------------------------------------------------------------------- */

.admin-shell { min-height: 100vh; }

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--teal-dark);
    color: #fff;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .26s var(--bounce);
}

.admin-sidebar.is-open { transform: translateX(0); }

.admin-sidebar .brand-name,
.admin-sidebar .brand-sub { color: #fff; }

.admin-sidebar .brand-sub { color: rgba(255, 255, 255, .7); }

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: var(--space-xs);
}

.admin-nav-group {
    margin: var(--space-sm) 0 2px;
    padding-left: 14px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--tap);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, .88);
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .18s ease, transform .18s var(--bounce);
}

.admin-nav a .ico { font-size: 18px; width: 22px; text-align: center; flex: 0 0 22px; }

.admin-nav a:hover {
    background: rgba(255, 255, 255, .12);
    text-decoration: none;
    transform: translateX(2px);
}

.admin-nav a.is-active {
    background: var(--gold);
    color: var(--ink-dark);
    box-shadow: var(--shadow-gold-glow);
}

.admin-sidebar-foot {
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 3px dashed rgba(255, 255, 255, .2);
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
}

.admin-body { display: flex; flex-direction: column; min-height: 100vh; }

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-height: 68px;
    padding: 12px var(--space-md);
    background: var(--surface-card);
    border-bottom: 3px solid var(--teal-bg);
    box-shadow: var(--shadow-sm);
}

.admin-topbar h1 { margin: 0; font-size: 19px; }
.admin-topbar .spacer { flex: 1; }

.sidebar-toggle {
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    flex: 0 0 var(--tap);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--teal-bg);
    color: var(--teal-dark);
    font-size: 20px;
    cursor: pointer;
}

.admin-content { flex: 1; padding: var(--space-md); }
.admin-content > .page-head { margin-bottom: var(--space-md); }

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-sm);
}

.page-head p { margin: 4px 0 0; }

.sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(22, 63, 61, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

.sidebar-scrim.is-open { opacity: 1; pointer-events: auto; }

@media (min-width: 1024px) {
    .admin-sidebar { transform: none; }
    .admin-body { margin-left: var(--sidebar-w); }
    .sidebar-toggle, .sidebar-scrim { display: none; }
    .admin-content { padding: var(--space-lg); }
}

/* --------------------------------------------------------------------------
   Halaman masuk dan pemasang
   -------------------------------------------------------------------------- */

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: var(--space-md);
    background:
        radial-gradient(900px 420px at 15% -10%, rgba(255, 210, 63, .22), transparent 60%),
        radial-gradient(760px 380px at 105% 110%, rgba(239, 108, 74, .18), transparent 60%),
        var(--surface);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: var(--space-lg);
    background: var(--surface-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.auth-card.is-wide { max-width: 720px; }

.auth-head { text-align: center; margin-bottom: var(--space-lg); }
.auth-head .brand { justify-content: center; }

/* Langkah pemasangan */
.steps {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    list-style: none;
    padding: 0;
    font-size: 12.5px;
    font-weight: 800;
}

.steps li {
    flex: 1;
    padding: 10px 12px;
    text-align: center;
    border-radius: var(--radius-md);
    background: var(--teal-bg);
    color: var(--ink-soft);
}

.steps li.is-active { background: var(--teal); color: #fff; box-shadow: var(--shadow-teal-glow); }
.steps li.is-done { background: var(--gold-light); color: #7A5C00; }

/* --------------------------------------------------------------------------
   Impor: kotak contoh JSON dan prompt AI
   -------------------------------------------------------------------------- */

.code-box {
    position: relative;
    margin: 0;
    padding: var(--space-sm);
    background: var(--ink-dark);
    color: #D7F2F0;
    border-radius: var(--radius-md);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 420px;
    overflow: auto;
}

.code-box-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}

.import-result {
    display: grid;
    gap: var(--space-xs);
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-bottom: var(--space-md);
}

.import-result .cell {
    padding: 12px var(--space-sm);
    background: var(--cream);
    border-radius: var(--radius-md);
    text-align: center;
}

.import-result .num { font-size: 24px; font-weight: 800; color: var(--teal-dark); line-height: 1.2; }
.import-result .cap { font-size: 12px; font-weight: 700; color: var(--ink-soft); }

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: var(--space-md);
    padding: 6px;
    background: var(--teal-bg);
    border-radius: var(--radius-round);
    overflow-x: auto;
}

.tabs a, .tabs button {
    flex: 1 0 auto;
    min-height: 38px;
    padding: 8px 18px;
    border: 0;
    border-radius: var(--radius-round);
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    color: var(--teal-dark);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.tabs .is-active {
    background: var(--surface-card);
    box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Pemilih papan nama
   -------------------------------------------------------------------------- */

.pick-list {
    display: grid;
    gap: var(--space-xs);
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    max-height: 60vh;
    overflow-y: auto;
    padding: 4px;
}

.pick {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--space-sm);
    background: var(--cream);
    border: 2px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.pick:hover { border-color: var(--teal-light); }

.pick input { width: 20px; height: 20px; accent-color: var(--teal); flex: 0 0 20px; }

.pick:has(input:checked) {
    border-color: var(--teal);
    box-shadow: var(--shadow-focus);
    background: var(--teal-bg);
}

.pick-name { font-weight: 800; font-size: 14.5px; color: var(--teal-dark); line-height: 1.3; }
.pick-sci { font-size: 12.5px; font-style: italic; color: var(--ink-soft); }

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: var(--space-sm);
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* Pratinjau tata letak kertas A4 */
.sheet-preview {
    display: grid;
    gap: 4px;
    width: 128px;
    aspect-ratio: 210 / 297;
    padding: 5px;
    background: var(--surface-card);
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
}

.sheet-preview span {
    background: var(--teal-bg);
    border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Halaman galat: 401, 403, 404, 419, 500
   -------------------------------------------------------------------------- */

.error-card {
    width: 100%;
    max-width: 560px;
    padding: var(--space-xl) var(--space-lg);
    background: var(--surface-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.error-emoji {
    margin: 0;
    font-size: 56px;
    line-height: 1;
}

/* Angka galat meminjam perlakuan angka 7 pada logo Flip7: emas, sangat tebal,
   miring sedikit, dengan garis luar gelap berlapis dari text-shadow. */
.error-code {
    margin: 4px 0 var(--space-sm);
    font-size: clamp(64px, 16vw, 104px);
    font-weight: 800;
    line-height: 1;
    color: var(--gold);
    transform: rotate(-3deg);
    text-shadow:
        3px 3px 0 var(--teal-dark),
        -2px -2px 0 var(--teal-dark),
        2px -2px 0 var(--teal-dark),
        -2px 2px 0 var(--teal-dark);
}

.error-card h1 {
    margin-bottom: var(--space-xs);
}

.error-lead {
    margin-bottom: var(--space-xs);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink-dark);
}

.error-search {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-md);
    padding: var(--space-xs);
    background: var(--teal-bg);
    border-radius: var(--radius-round);
}

.error-search .input {
    border: 0;
    background: var(--surface-card);
}

.error-search .input:focus {
    box-shadow: var(--shadow-focus);
}

.error-actions {
    justify-content: center;
    margin-top: var(--space-md);
}

.error-detail {
    margin: var(--space-md) 0 0;
    padding: var(--space-sm);
    text-align: left;
    background: var(--cream);
    border: 2px solid var(--coral);
    border-radius: var(--radius-md);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow: auto;
}

.error-rule {
    margin: var(--space-lg) 0 var(--space-sm);
    border: 0;
    border-top: 3px dashed var(--line);
}

/* --------------------------------------------------------------------------
   Cetak
   -------------------------------------------------------------------------- */

@media print {
    .admin-sidebar,
    .admin-topbar,
    .sidebar-scrim,
    .public-header,
    .public-footer,
    .btn,
    .pagination { display: none !important; }

    body { background: #fff; }
    .admin-body { margin-left: 0; }
    .card, .stat, .table-wrap { box-shadow: none; border: 1px solid #ccc; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
