
  /* ─── GOOGLE FONTS ──────────────────────────────────────── */
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

  /* ─── VARIABLES ─────────────────────────────────────────── */
  :root {
    --hijau:        #1a5c38;
    --hijau-muda:   #2e8b57;
    --hijau-terang: #e8f5ef;
    --emas:         #c9972a;
    --emas-muda:    #f0c55a;
    --putih:        #f5f7f5;
    --card-bg:      #ffffff;
    --border:       #e2e8e4;
    --teks:         #1a1f1a;
    --teks-muted:   #6b7770;
    --available:    #1a5c38;
    --booked:       #c9972a;
    --pemberkasan:  #1a6ba8;
    --sp3k:         hsl(273, 77%, 31%);
    --akad:         #c0392b;
    --shadow-sm:    0 1px 4px rgba(0,0,0,0.07);
    --shadow-md:    0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg:    0 12px 40px rgba(0,0,0,0.16);
    --radius-sm:    8px;
    --radius-md:    12px;
    --radius-lg:    18px;
    --header-h:     64px;
    --filter-h:     56px;
    --font:         'Inter', 'Segoe UI', Arial, sans-serif;
  }

  /* ─── RESET ─────────────────────────────────────────────── */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
  body {
    font-family: var(--font);
    background: var(--putih);
    color: var(--teks);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
  }

  /* ─── HEADER ────────────────────────────────────────────── */
  .header {
    background: linear-gradient(135deg, #1a5c38 0%, #0d3d24 60%, #0a2e1b 100%);
    color: #fff;
    padding: 0 clamp(16px, 4vw, 40px);
    height: auto;
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    position: sticky; top: 0; z-index: 200;
    padding-top: 12px; padding-bottom: 12px;
  }
  .header-brand { display: flex; align-items: center; gap: 12px; }
  .header-logo {
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
  }
  .header-left h1 { font-size: clamp(1rem, 2.5vw, 1.35rem); font-weight: 800; letter-spacing: -0.3px; }
  .header-left p  { font-size: 0.72rem; opacity: 0.65; margin-top: 1px; }
  .header-stats { display: flex; gap: 8px; flex-wrap: wrap; }
  .stat-pill {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    padding: 5px 12px;
    text-align: center;
    min-width: 68px;
    transition: background 0.2s;
  }
  .stat-pill:hover { background: rgba(255,255,255,0.18); }
  .stat-pill .num { font-size: 1.25rem; font-weight: 800; display: block; line-height: 1.1; }
  .stat-pill .lbl { font-size: 0.62rem; opacity: 0.75; letter-spacing: 0.3px; text-transform: uppercase; }
  .stat-pill.available   .num { color: #6ee9b5; }
  .stat-pill.booked      .num { color: #fdd470; }
  .stat-pill.pemberkasan .num { color: #7ec8f8; }
  .stat-pill.sp3k        .num { color: #fbb96b; }
  .stat-pill.akad        .num { color: #f08080; }

  /* ─── FILTER BAR ────────────────────────────────────────── */
  .controls {
    background: var(--card-bg);
    padding: 10px clamp(16px, 4vw, 40px);
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 100;
  }
  .filter-group { display: flex; align-items: center; gap: 6px; }
  .filter-group label { font-size: 0.72rem; color: var(--teks-muted); font-weight: 600; white-space: nowrap; }
  .controls select,
  .controls input[type=text] {
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 7px 10px; font-size: 0.82rem; background: var(--putih);
    color: var(--teks); outline: none; font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s;
    height: 36px;
  }
  .controls select:focus,
  .controls input[type=text]:focus {
    border-color: var(--hijau-muda);
    box-shadow: 0 0 0 3px rgba(46,139,87,0.12);
  }
  .controls input[type=text] { width: clamp(120px, 18vw, 180px); }
  .filter-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

  .legend {
    margin-left: auto; display: flex; gap: 10px; align-items: center; flex-shrink: 0; flex-wrap: wrap;
  }
  .leg { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--teks-muted); white-space: nowrap; }
  .leg-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

  /* ─── MAIN CONTENT ──────────────────────────────────────── */
  #main-content { padding: clamp(12px, 3vw, 28px) clamp(12px, 4vw, 40px); }

  /* ─── BLOK SECTION ──────────────────────────────────────── */
  .blok-section {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: clamp(14px, 3vw, 22px);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
  }
  .blok-title {
    font-size: 0.95rem; font-weight: 700; color: var(--hijau);
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 2px solid var(--hijau-terang);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .blok-title .blok-name { font-size: 1.05rem; }
  .blok-title span.badge {
    color: white; font-size: 0.65rem; padding: 2px 8px;
    border-radius: 20px; font-weight: 700; letter-spacing: 0.2px;
  }

  /* ─── KAVLING GRID ──────────────────────────────────────── */
  .kavling-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 7px;
  }
  .kav-card {
    aspect-ratio: 1 / 1.05;
    border-radius: var(--radius-sm);
    padding: 6px 5px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    position: relative;
    border: 2px solid transparent;
    user-select: none;
    text-align: center;
    min-height: 68px;
  }
  .kav-card:active { transform: scale(0.95); }
  .kav-card.available  { background: #e8f5ef; border-color: var(--available);   color: var(--available); }
  .kav-card.booked     { background: #fdf4dc; border-color: var(--booked);      color: #7a5200; }
  .kav-card.pemberkasan{ background: #ddf0fc; border-color: var(--pemberkasan); color: #1a4f7a; }
  .kav-card.sp3k       { background: #fef0d8; border-color: var(--sp3k);        color: #7a4200; }
  .kav-card.akad       { background: #fde8e8; border-color: var(--akad);        color: var(--akad); }
  @media (hover: hover) {
    .kav-card.available:hover   { background: var(--available);   color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .kav-card.booked:hover      { background: var(--booked);      color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .kav-card.pemberkasan:hover { background: var(--pemberkasan); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .kav-card.sp3k:hover        { background: var(--sp3k);        color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .kav-card.akad:hover        { background: var(--akad);        color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
  }
  .kav-no    { font-size: 1rem; font-weight: 800; display: block; line-height: 1; }
  .kav-harga { font-size: 0.58rem; opacity: 0.7; display: block; margin-top: 3px; }
  .kav-nama  {
    font-size: 0.56rem; font-weight: 600; display: block; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: calc(100% - 4px);
  }
  .kav-status-icon { font-size: 0.55rem; position: absolute; top: 3px; right: 4px; opacity: 0.55; }

  /* ─── MODAL ─────────────────────────────────────────────── */
  .modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center; justify-content: center;
    padding: 16px;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.22s cubic-bezier(.34,1.3,.64,1);
  }
  @keyframes fadeUp {
    from { transform: translateY(24px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
  }
  .modal-header {
    background: linear-gradient(135deg, var(--hijau), #0d3d24);
    color: white;
    padding: 18px 20px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px;
    position: sticky; top: 0; z-index: 10;
  }
  .modal-header-info h2 { font-size: 1.05rem; font-weight: 800; }
  .modal-header-info p  { font-size: 0.72rem; opacity: 0.7; margin-top: 2px; }
  .modal-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  .status-badge {
    font-size: 0.7rem; padding: 3px 10px; border-radius: 20px; font-weight: 700; white-space: nowrap;
  }
  .badge-available   { background: #6ee9b5; color: #0d3d24; }
  .badge-booked      { background: #fdd470; color: #5a3900; }
  .badge-pemberkasan { background: #7ec8f8; color: #0a3d6b; }
  .badge-sp3k        { background: #fbb96b; color: #5a2d00; }
  .badge-akad        { background: #f08080; color: #5a0000; }
  .close-btn {
    background: rgba(255,255,255,0.15); border: none; color: white;
    font-size: 1.1rem; cursor: pointer; border-radius: 50%;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s; flex-shrink: 0;
  }
  .close-btn:hover { background: rgba(255,255,255,0.3); }
  .modal-body { padding: clamp(14px, 4vw, 22px); display: flex; flex-direction: column; gap: 14px; }

  /* ─── SECTION BLOCK ─────────────────────────────────────── */
  .section-block {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  .section-block-title {
    font-size: 0.8rem; font-weight: 700; color: var(--hijau);
    padding: 9px 14px; background: #f0f8f4;
    border-bottom: 1.5px solid #d0ead9;
    display: flex; align-items: center; gap: 6px;
  }
  .section-block-body { padding: 14px; }
  .konsumen-section { border-color: #b8dbc9; }
  .konsumen-section .section-block-title { background: #e4f5ec; border-bottom-color: #b8dbc9; }

  /* ─── FORM GRID ─────────────────────────────────────────── */
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-grid .span2 { grid-column: 1 / -1; }
  .form-group label {
    display: block; font-size: 0.7rem; color: var(--teks-muted);
    font-weight: 600; margin-bottom: 4px; letter-spacing: 0.2px;
  }
  .form-group input,
  .form-group select {
    width: 100%; padding: 9px 11px;
    border: 1.5px solid #cce0d4; border-radius: var(--radius-sm);
    font-size: 0.84rem; outline: none; background: white;
    font-family: var(--font); color: var(--teks);
    transition: border-color 0.15s, box-shadow 0.15s;
    height: 40px;
  }
  .form-group input:focus,
  .form-group select:focus {
    border-color: var(--hijau-muda);
    box-shadow: 0 0 0 3px rgba(46,139,87,0.12);
  }

  /* ─── PURCHASE TABS ─────────────────────────────────────── */
  .purchase-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: var(--putih);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    overflow: hidden;
    margin-bottom: 14px;
  }
  .purchase-tab {
    padding: 9px 6px;
    text-align: center;
    cursor: pointer;
    font-size: 0.72rem; font-weight: 600; color: var(--teks-muted);
    transition: background 0.15s, color 0.15s;
    border-right: 1px solid var(--border);
    line-height: 1.3;
  }
  .purchase-tab:last-child { border-right: none; }
  .purchase-tab.active { background: var(--hijau); color: white; }
  .purchase-tab:not(.active):hover { background: var(--hijau-terang); color: var(--hijau); }
  .purchase-panel { display: none; }
  .purchase-panel.active { display: block; }

  /* ─── PRICE TABLE ───────────────────────────────────────── */
  .price-section-label {
    font-size: 0.72rem; font-weight: 700; color: var(--hijau);
    background: #eef7f2; border-radius: 6px;
    padding: 5px 9px; margin-bottom: 6px; letter-spacing: 0.2px;
  }
  .price-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-bottom: 10px; }
  .price-table tr { border-bottom: 1px solid #f0f5f2; }
  .price-table td { padding: 7px 6px; }
  .price-table td:first-child { color: var(--teks-muted); }
  .price-table td:last-child { text-align: right; font-weight: 600; color: var(--hijau); white-space: nowrap; }
  .price-table tr.subtotal td {
    background: #edf6ef; font-weight: 600; color: var(--hijau);
    border-top: 1px solid #c8e0d2; border-bottom: 1px solid #c8e0d2;
  }
  .price-table tr.subtotal td:first-child { color: var(--hijau); }
  .price-table tr.total td {
    background: var(--hijau); color: white !important;
    font-weight: 700; font-size: 0.85rem;
  }
  .price-table tr.total td:last-child { color: #6ee9b5 !important; }
  .section-label { color: var(--teks-muted); font-size: 0.72rem; font-style: italic; }

  /* ─── SAVE BAR ──────────────────────────────────────────── */
  .save-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; background: #f0f8f4;
    border: 1.5px solid #b8dbc9; border-radius: var(--radius-md);
    padding: 12px 14px;
  }
  .save-preview { font-size: 0.78rem; color: var(--teks); flex: 1; line-height: 1.4; }
  .btn-save {
    padding: 10px 22px; background: var(--hijau); color: white;
    border: none; border-radius: var(--radius-sm); font-weight: 700;
    cursor: pointer; font-size: 0.84rem; font-family: var(--font);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    white-space: nowrap; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(26,92,56,0.3);
  }
  .btn-save:hover { background: var(--hijau-muda); box-shadow: 0 4px 12px rgba(26,92,56,0.4); }
  .btn-save:active { transform: scale(0.97); }

  /* ─── NO RESULT ─────────────────────────────────────────── */
  .no-result {
    padding: 60px 20px; text-align: center;
    color: var(--teks-muted); font-size: 0.9rem;
  }
  .no-result-icon { font-size: 2.5rem; display: block; margin-bottom: 10px; opacity: 0.4; }

  /* ─── TOAST ─────────────────────────────────────────────── */
  .toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--hijau); color: white; padding: 12px 20px;
    border-radius: 10px; font-weight: 600; font-size: 0.85rem;
    font-family: var(--font);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25); z-index: 2000;
    display: none; animation: fadeUp 0.22s ease;
    max-width: calc(100vw - 48px);
  }

  /* ─── HIGHLIGHT ROW ─────────────────────────────────────── */
  .price-table tr[style*="background:#fffbe6"] td:first-child { color: var(--teks); }
  /* ─── RIWAYAT PEMBAYARAN ────────────────────────────────────── */
  .riwayat-section { border-color: #c0d8ea; }
  .riwayat-section .section-block-title { background: #e4f0f8; border-bottom-color: #c0d8ea; color: #1a4f7a; }
  .riwayat-tagihan-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
    background: #f5faff; border: 1px solid #c0d8ea;
    border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 10px;
  }
  .tagihan-info { font-size: 0.8rem; color: var(--teks); line-height: 1.6; }
  .tagihan-info .lbl { color: var(--teks-muted); font-size: 0.7rem; display: block; }
  .tagihan-info .val { font-weight: 700; color: var(--hijau); font-size: 0.92rem; }
  .tagihan-info .val.merah { color: #c0392b; }
  .riwayat-form {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;
  }
  .riwayat-form .span2 { grid-column: 1 / -1; }
  .riwayat-form input {
    width: 100%; padding: 8px 10px;
    border: 1.5px solid #cce0d4; border-radius: var(--radius-sm);
    font-size: 0.82rem; outline: none; font-family: var(--font);
    transition: border-color 0.15s; height: 38px;
  }
  .riwayat-form input:focus { border-color: var(--hijau-muda); box-shadow: 0 0 0 3px rgba(46,139,87,0.12); }
  .btn-add-bayar {
    width: 100%; padding: 9px; background: #1a6ba8; color: white;
    border: none; border-radius: var(--radius-sm); font-weight: 700;
    cursor: pointer; font-size: 0.82rem; font-family: var(--font);
    transition: background 0.15s; display: flex; align-items: center; justify-content: center; gap: 6px;
  }
  .btn-add-bayar:hover { background: #1558a0; }
  .riwayat-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
  .riwayat-item {
    display: flex; align-items: flex-start; gap: 10px;
    background: #f8fcff; border: 1px solid #d0e8f5;
    border-radius: var(--radius-sm); padding: 9px 12px;
  }
  .riwayat-item-info { flex: 1; }
  .ri-tanggal { color: var(--teks-muted); font-size: 0.7rem; }
  .ri-jumlah  { font-weight: 700; color: #1a6ba8; font-size: 0.88rem; }
  .ri-ket     { color: var(--teks); font-size: 0.78rem; margin-top: 1px; }
  .riwayat-item-delete {
    background: none; border: none; color: #c0392b; cursor: pointer;
    font-size: 1rem; padding: 2px 5px; border-radius: 4px; flex-shrink: 0;
    transition: background 0.15s;
  }
  .riwayat-item-delete:hover { background: #fde8e8; }
  .riwayat-empty { text-align: center; color: var(--teks-muted); font-size: 0.78rem; padding: 14px 0; }

  /* ─── TOMBOL CETAK ──────────────────────────────────────────── */
  .btn-cetak {
    padding: 10px 18px; background: #6b4f9e; color: white;
    border: none; border-radius: var(--radius-sm); font-weight: 700;
    cursor: pointer; font-size: 0.84rem; font-family: var(--font);
    transition: background 0.15s; white-space: nowrap; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(107,79,158,0.3);
  }
  .btn-cetak:hover { background: #563e80; }

  /* ─── ACTION BAR ─────────────────────────────────────────────── */
  .action-bar {
    display: flex; gap: 8px; flex-wrap: wrap;
    background: #f0f8f4; border: 1.5px solid #b8dbc9;
    border-radius: var(--radius-md); padding: 12px 14px;
    align-items: center;
  }
  .action-bar .save-preview { flex: 1; font-size: 0.78rem; color: var(--teks); min-width: 120px; }

  /* ─── PRINT STYLES ──────────────────────────────────────────── */
  #print-area { display: none; }
  @media print {
    body > *:not(#print-area) { display: none !important; }
    #print-area {
      display: block !important; position: fixed; inset: 0;
      background: white; z-index: 99999; padding: 24px 28px;
      font-family: 'Inter', Arial, sans-serif; font-size: 12px; color: #111;
    }
    .print-logo  { font-size: 1.1rem; font-weight: 800; color: #1a5c38; }
    .print-sub   { font-size: 0.72rem; color: #666; margin-bottom: 14px; border-bottom: 2px solid #1a5c38; padding-bottom: 8px; }
    .print-title { font-size: 1rem; font-weight: 700; color: #1a5c38; margin-bottom: 10px; }
    .print-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; margin-bottom: 14px; }
    .print-grid dt { color: #777; font-size: 0.72rem; }
    .print-grid dd { font-weight: 600; margin: 0 0 4px; font-size: 0.8rem; }
    .print-sec-title { font-weight: 700; font-size: 0.8rem; background: #e8f5ef; padding: 4px 8px; border-left: 3px solid #1a5c38; margin: 12px 0 6px; }
    .print-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; margin-bottom: 10px; }
    .print-table th { background: #1a5c38; color: white; padding: 5px 8px; text-align: left; }
    .print-table td { padding: 5px 8px; border-bottom: 1px solid #e0ece6; }
    .print-table tr:nth-child(even) td { background: #f5faf7; }
    .print-row-total { background: #d4edda !important; font-weight: 700; }
    .print-row-sisa  { background: #fde8e8 !important; font-weight: 700; color: #c0392b; }
    .print-footer { margin-top: 16px; font-size: 0.68rem; color: #999; border-top: 1px solid #ddd; padding-top: 8px; display: flex; justify-content: space-between; }
  }


  /* ════════════════════════════════════════════════════════════
     RESPONSIVE — TABLET (≤ 900px)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 900px) {
    .header-stats { gap: 6px; }
    .stat-pill { min-width: 56px; padding: 5px 9px; }
    .stat-pill .num { font-size: 1.1rem; }
    .kavling-grid { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); }
  }

  /* ════════════════════════════════════════════════════════════
     RESPONSIVE — MOBILE (≤ 640px)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 640px) {
    /* Header */
    .header { flex-direction: column; align-items: flex-start; padding: 12px 16px; gap: 10px; }
    .header-stats { width: 100%; justify-content: space-between; }
    .stat-pill { flex: 1; min-width: 0; padding: 5px 4px; }
    .stat-pill .num { font-size: 1rem; }
    .stat-pill .lbl { font-size: 0.55rem; }

    /* Filter bar — scrollable single row */
    .controls {
      padding: 8px 12px;
      overflow-x: auto;
      flex-wrap: nowrap;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      gap: 6px;
    }
    .controls::-webkit-scrollbar { display: none; }
    .filter-group { flex-shrink: 0; }
    .controls select { height: 34px; font-size: 0.78rem; padding: 0 8px; }
    .controls input[type=text] { width: 130px; height: 34px; }
    .legend { display: none; }
    .filter-divider { display: none; }

    /* Blok section */
    #main-content { padding: 10px 10px; }
    .blok-section { padding: 12px 10px; margin-bottom: 10px; border-radius: var(--radius-sm); }
    .blok-title { font-size: 0.88rem; margin-bottom: 10px; gap: 6px; }
    .blok-title .blok-name { font-size: 0.95rem; }
    .blok-title span.badge { font-size: 0.6rem; padding: 2px 6px; }

    /* Kavling cards — tighter grid */
    .kavling-grid { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 5px; }
    .kav-card { min-height: 58px; border-radius: 7px; }
    .kav-no { font-size: 0.88rem; }
    .kav-harga { font-size: 0.52rem; }

    /* Modal — full-screen bottom sheet on mobile */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal {
      max-width: 100%;
      max-height: 92dvh;
      border-radius: var(--radius-lg) var(--radius-lg) 0 0;
      animation: slideUp 0.26s cubic-bezier(.34,1.1,.64,1);
    }
    @keyframes slideUp {
      from { transform: translateY(100%); opacity: 0.8; }
      to   { transform: translateY(0); opacity: 1; }
    }
    /* Drag handle */
    .modal::before {
      content: '';
      display: block;
      width: 40px; height: 4px;
      background: rgba(0,0,0,0.15);
      border-radius: 2px;
      margin: 10px auto 0;
    }
    .modal-header { border-radius: 0; }
    .modal-body { padding: 14px 14px; gap: 12px; }

    /* Form grid → 1 col */
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span2 { grid-column: 1; }
    .form-group input,
    .form-group select { height: 44px; font-size: 16px; } /* 16px prevents iOS zoom */

    /* Purchase tabs → 2×2 grid */
    .purchase-tabs {
      grid-template-columns: 1fr 1fr;
    }
    .purchase-tab {
      border-right: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
    }
    .purchase-tab:nth-child(2) { border-right: none; }
    .purchase-tab:nth-child(3) { border-bottom: none; }
    .purchase-tab:nth-child(4) { border-right: none; border-bottom: none; }

    /* Save/action bar → stack */
    .save-bar  { flex-direction: column; align-items: stretch; gap: 8px; }
    .action-bar { flex-direction: column; align-items: stretch; gap: 8px; }
    .btn-save  { width: 100%; padding: 13px; font-size: 0.9rem; text-align: center; }
    .btn-cetak { width: 100%; padding: 12px; font-size: 0.9rem; text-align: center; }
    /* Riwayat form → 1 kolom */
    .riwayat-form { grid-template-columns: 1fr; }
    .riwayat-form .span2 { grid-column: 1; }
    .riwayat-form input { height: 44px; font-size: 16px; }
    .riwayat-tagihan-bar { gap: 14px; }

    /* Price table */
    .price-table { font-size: 0.76rem; }
    .price-table td { padding: 6px 4px; }

    /* Toast */
    .toast { bottom: 16px; right: 12px; left: 12px; text-align: center; }
  }

  /* ════════════════════════════════════════════════════════════
     RESPONSIVE — VERY SMALL (≤ 360px)
  ════════════════════════════════════════════════════════════ */
  @media (max-width: 360px) {
    .kavling-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; }
    .kav-card { min-height: 52px; }
    .kav-no { font-size: 0.8rem; }
    .stat-pill .num { font-size: 0.9rem; }
  }

  /* ════════════════════════════════════════════════════════════
     PC — LARGE (≥ 1200px) refinements
  ════════════════════════════════════════════════════════════ */
  @media (min-width: 1200px) {
    .kavling-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 9px; }
    .kav-card { min-height: 76px; }
    .kav-no { font-size: 1.1rem; }
    .modal { max-width: 600px; }
  }

/* ════════════════════════════════════════════════════════════
   TAMBAHAN: LOGIN PAGE
════════════════════════════════════════════════════════════ */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a5c38 0%, #0d3d24 55%, #0a2e1b 100%);
  padding: 20px;
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 6vw, 40px) clamp(20px, 6vw, 36px);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--hijau-terang);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 14px;
}
.login-brand h1 { font-size: 1.2rem; font-weight: 800; color: var(--hijau); }
.login-brand p { font-size: 0.76rem; color: var(--teks-muted); margin-top: 4px; line-height: 1.4; }
.login-alert {
  background: #fde8e8; border: 1.5px solid #f3b8b8; color: #a02020;
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.8rem; margin-bottom: 16px;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .form-group label {
  display: block; font-size: 0.76rem; color: var(--teks-muted);
  font-weight: 600; margin-bottom: 5px;
}
.login-form input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; outline: none; font-family: var(--font);
  height: 46px; transition: border-color 0.15s, box-shadow 0.15s;
}
.login-form input:focus {
  border-color: var(--hijau-muda);
  box-shadow: 0 0 0 3px rgba(46,139,87,0.14);
}
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.toggle-pass {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem;
  padding: 6px; opacity: 0.6;
}
.toggle-pass:hover { opacity: 1; }
.btn-login {
  margin-top: 6px; padding: 13px; background: var(--hijau); color: #fff;
  border: none; border-radius: var(--radius-sm); font-weight: 700;
  font-size: 0.92rem; font-family: var(--font); cursor: pointer;
  transition: background 0.15s; box-shadow: 0 4px 14px rgba(26,92,56,0.3);
}
.btn-login:hover { background: var(--hijau-muda); }
.login-footer { text-align: center; font-size: 0.7rem; color: var(--teks-muted); margin-top: 20px; }

/* ════════════════════════════════════════════════════════════
   TAMBAHAN: TOPBAR USER INFO (di app.php)
════════════════════════════════════════════════════════════ */
.header-user {
  display: flex; align-items: center; gap: 10px;
  margin-left: 6px;
  padding-left: 14px;
  border-left: 1px solid rgba(255,255,255,0.2);
}
.header-user-info { text-align: right; line-height: 1.25; }
.header-user-name { font-size: 0.78rem; font-weight: 700; color: #fff; }
.header-user-role { font-size: 0.62rem; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 0.4px; }
.header-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.header-user-actions { display: flex; gap: 6px; }
.btn-header-icon {
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; font-size: 0.9rem;
  transition: background 0.15s;
}
.btn-header-icon:hover { background: rgba(255,255,255,0.25); }

@media (max-width: 640px) {
  .header-user { border-left: none; padding-left: 0; margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ════════════════════════════════════════════════════════════
   TAMBAHAN: HALAMAN MANAJEMEN AKUN (users.php)
════════════════════════════════════════════════════════════ */
.users-page { max-width: 760px; margin: 0 auto; padding: clamp(16px, 4vw, 32px); }
.users-back { display: inline-flex; align-items: center; gap: 6px; color: var(--hijau); font-weight: 600; font-size: 0.85rem; text-decoration: none; margin-bottom: 16px; }
.users-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 20px; }
.users-card h2 { font-size: 1rem; color: var(--hijau); margin-bottom: 14px; }
.users-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.users-table th { text-align: left; color: var(--teks-muted); font-size: 0.72rem; text-transform: uppercase; padding: 8px; border-bottom: 2px solid var(--border); }
.users-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.role-pill { font-size: 0.68rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; }
.role-pill.admin { background: #fde8e8; color: #a02020; }
.role-pill.staff { background: #e4f0f8; color: #1a4f7a; }
.users-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.users-form .span2 { grid-column: 1/-1; }
.users-form label { display: block; font-size: 0.76rem; color: var(--teks-muted); font-weight: 600; margin-bottom: 5px; }
.users-form input, .users-form select {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.85rem; height: 40px; font-family: var(--font); outline: none;
}
.users-form input:focus, .users-form select:focus { border-color: var(--hijau-muda); box-shadow: 0 0 0 3px rgba(46,139,87,0.12); }
.btn-users-submit {
  grid-column: 1/-1; padding: 11px; background: var(--hijau); color: #fff; border: none;
  border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; font-family: var(--font);
}
.btn-users-submit:hover { background: var(--hijau-muda); }
.btn-danger-sm { background: #fde8e8; color: #a02020; border: 1px solid #f3b8b8; border-radius: 6px; padding: 5px 10px; font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.btn-danger-sm:hover { background: #fbd4d4; }
.badge-you { font-size: 0.62rem; color: var(--teks-muted); font-style: italic; margin-left: 6px; }
@media (max-width: 640px) {
  .users-form { grid-template-columns: 1fr; }
  .users-table { font-size: 0.78rem; }
  .users-table th:nth-child(3), .users-table td:nth-child(3) { display: none; }
}
