@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0a0c;
  --surface:  #111114;
  --surface2: #18181c;
  --border:   #232328;
  --border2:  #2e2e36;
  --text:     #f0f0f2;
  --muted:    #52525e;
  --muted2:   #6b6b7a;
  --accent:   #7c5cfc;
  --accent2:  #5b8af7;
  --success:  #22c55e;
  --warn:     #f59e0b;
  --danger:   #ef4444;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,12,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-name {
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.nav-pills {
  display: flex;
  gap: 4px;
}

.nav-pills a {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--muted2);
  text-decoration: none;
  transition: all .15s;
}

.nav-pills a:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-pills a.active {
  background: rgba(124,92,252,0.15);
  color: #a78bfa;
}

/* ── Layout ──────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

.container.wide {
  max-width: 600px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 12px;
}

/* ── Typography ──────────────────────────────────── */

.page-title {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--text);
  letter-spacing: -0.3px;
}

.page-title span { color: var(--accent); }

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .7px;
  color: var(--muted2);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Form ────────────────────────────────────────── */

.field { margin-bottom: 16px; }

input, select {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  appearance: none;
}

input:focus, select:focus { border-color: var(--accent); }
input::placeholder { color: var(--muted); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2352525e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.file-hint {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 6px;
}

/* ── Buttons ─────────────────────────────────────── */

.btn {
  display: block;
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  text-align: center;
  text-decoration: none;
}

.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.btn-ghost {
  background: var(--surface2);
  color: var(--muted2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border2); }

/* ── Kode box ────────────────────────────────────── */

.kode-box {
  background: rgba(124,92,252,0.07);
  border: 1px solid rgba(124,92,252,0.2);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin: 20px 0;
}

.kode-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .7px;
  color: rgba(167,139,250,0.6);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.kode-value {
  font-family: 'DM Mono', monospace;
  font-size: 32px;
  font-weight: 500;
  color: #a78bfa;
  letter-spacing: 6px;
}

/* ── Info rows ───────────────────────────────────── */

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-row .key { color: var(--muted2); }
.info-row .val { font-weight: 500; }

/* ── Alert ───────────────────────────────────────── */

.alert {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--muted2);
  margin-bottom: 16px;
}
.alert.error { border-color: var(--danger); color: var(--danger); }

/* ── Empty ───────────────────────────────────────── */

.empty {
  text-align: center;
  padding: 48px 0;
  color: var(--muted);
  font-size: 14px;
}

/* ── Search ──────────────────────────────────────── */

.search-wrap {
  position: relative;
  margin-bottom: 16px;
}
.search-wrap input { padding-left: 40px; }
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ── Dashboard header ────────────────────────────── */

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
.dash-header .page-title { margin-bottom: 0; }

.btn-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--muted2);
  cursor: pointer;
  transition: border-color .2s, color .2s, transform .3s;
  flex-shrink: 0;
}
.btn-refresh:hover { border-color: var(--accent); color: var(--text); }
.btn-refresh:active { transform: rotate(180deg); }

/* ── Stat cards ──────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.stat-num {
  font-size: 24px;
  font-weight: 500;
  color: #a78bfa;
}

.stat-label {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 2px;
}

/* ── Folder tree ─────────────────────────────────── */

.folder { margin-bottom: 6px; }

.folder summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background .15s;
}
.folder summary::-webkit-details-marker { display: none; }

.bulan-folder > summary {
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 500;
  font-size: 14px;
}
.bulan-folder > summary:hover { border-color: var(--accent); }

.paket-folder > summary {
  background: var(--surface2);
  font-size: 13px;
  font-weight: 500;
  margin-left: 16px;
}
.paket-folder > summary:hover { background: var(--border); }

.folder-icon { font-size: 15px; flex-shrink: 0; }
.folder-name { flex: 1; }
.folder-count {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 99px;
}

.folder-content { margin-left: 16px; margin-top: 4px; }

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-left: 16px;
  margin-bottom: 2px;
  border-radius: 8px;
  font-size: 13px;
  transition: background .15s;
}
.file-row:hover { background: var(--surface2); }
.file-icon { flex-shrink: 0; font-size: 13px; }
.file-name { flex: 1; font-weight: 500; }
.file-meta { color: var(--muted); font-size: 12px; font-family: 'DM Mono', monospace; }

/* ── Days badge ──────────────────────────────────── */

.days-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-ok   { background: rgba(34,197,94,0.1);  color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.badge-warn { background: rgba(245,158,11,0.1); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.badge-danger { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

/* ── Client page ─────────────────────────────────── */

.client-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.client-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
}

.client-logo-mark {
  width: 90px;
  height: 90px;
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.client-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.client-logo-name {
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
}

.client-logo-sub {
  font-size: 13px;
  color: var(--muted2);
}

.client-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.kode-input {
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  letter-spacing: 8px;
  color: var(--text);
}