/* Arlydia Dokumen — gaya aplikasi */
:root {
  --bg: #f1f4f3;
  --card: #ffffff;
  --ink: #0e1a1f;
  --muted: #61727a;
  --line: #dde4e6;
  --line-soft: #edf1f2;
  --accent: #0d5c4a;
  --accent-dark: #094234;
  --accent-soft: #e6f1ee;
  --gold: #b5762a;
  --danger: #a52a1f;
  --danger-soft: #fdeceb;
  --warn-soft: #fdf4e3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 26, 31, .04), 0 8px 24px -18px rgba(14, 26, 31, .35);
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  height: 62px; padding: 0 26px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), #0a3f33);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: .04em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 8px 13px; border-radius: 9px; color: var(--muted);
  font-size: 14px; font-weight: 550;
}
.nav a:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav form { margin: 0; }
.nav button {
  border: 0; background: none; cursor: pointer; font: inherit;
  padding: 8px 13px; border-radius: 9px; color: var(--muted); font-weight: 550;
}
.nav button:hover { background: var(--line-soft); color: var(--ink); }

/* ---------- layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 30px 26px 70px; }
.page-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.head-actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card > h2 { margin-bottom: 16px; }
.card + .card, .grid-2 + .card, .card + .grid-2 { margin-top: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 .card + .card { margin-top: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: #f7f9f9; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { color: var(--danger); border-color: #f0cfcb; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font: inherit; font-size: 14px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ---------- alerts ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 16px; border-radius: 11px; margin-bottom: 18px; font-size: 14px;
  border: 1px solid;
}
.alert-error { background: var(--danger-soft); border-color: #f2cfcb; color: #7d1f16; }
.alert-warn { background: var(--warn-soft); border-color: #f0dcb4; color: #7a5212; }
.alert-ok { background: var(--accent-soft); border-color: #c9e2da; color: var(--accent-dark); }

/* ---------- dropzone ---------- */
.dropzone {
  display: block; border: 2px dashed #c6d2d4; border-radius: 16px;
  padding: 42px 24px; text-align: center; cursor: pointer;
  background: #fbfcfc; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center;
}
.dropzone .dz-title { font-weight: 650; font-size: 16px; }
.dropzone .dz-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.dropzone input[type=file] { display: none; }
.dz-file { margin-top: 10px; font-size: 13px; color: var(--accent); font-weight: 600; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.table tr:last-child td { border-bottom: 0; }
table.table td.right, table.table th.right { text-align: right; font-variant-numeric: tabular-nums; }
table.table tbody tr:hover { background: #fafcfc; }
.mono { font-variant-numeric: tabular-nums; }
.strong { font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- items editor ---------- */
table.items { width: 100%; border-collapse: collapse; font-size: 14px; }
table.items th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; padding: 0 6px 8px; white-space: nowrap;
}
table.items td { padding: 3px 4px; }
table.items .input { height: 36px; font-size: 13.5px; border-color: #e6ecee; }
table.items .input:focus { border-color: var(--accent); }
table.items td.num .input { text-align: right; }
table.items .del {
  border: 0; background: none; cursor: pointer; color: #9aa8ad;
  width: 30px; height: 30px; border-radius: 7px; font-size: 17px; line-height: 1;
}
table.items .del:hover { background: var(--danger-soft); color: var(--danger); }
.items-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- totals ---------- */
.totals { display: flex; flex-direction: column; gap: 10px; }
.total-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.total-row .k { color: var(--muted); font-size: 14px; }
.total-row .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.total-row.grand {
  border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px;
  font-size: 17px;
}
.total-row.grand .v { font-weight: 700; color: var(--accent-dark); }

/* ---------- action bar ---------- */
.actionbar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  margin: 22px -26px -70px; padding: 14px 26px;
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.actionbar .spacer { margin-left: auto; }
.actionbar .note { font-size: 13px; color: var(--muted); }

/* ---------- preview ---------- */
.preview-card { display: flex; flex-direction: column; }
.preview-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.preview-head h2 { margin: 0; }
.preview-head .badge { margin-left: auto; }
.frame {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #eef1f2; height: 560px;
}
.frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.preview-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 650;
  background: var(--accent-soft); color: var(--accent-dark);
}
.badge-grey { background: var(--line-soft); color: var(--muted); }
.badge-gold { background: #fbf1e0; color: #8a5a13; }

/* ---------- meta list ---------- */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 24px; }
.meta .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.meta .v { font-size: 15px; margin-top: 2px; }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(900px 500px at 15% -10%, #e3efeb 0%, transparent 60%),
  radial-gradient(700px 400px at 100% 0%, #eef0e9 0%, transparent 55%), var(--bg); }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { justify-content: center; margin-bottom: 22px; }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.login-card .btn { width: 100%; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .big { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }

/* ---------- misc ---------- */
.hr { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.flex { display: flex; align-items: center; gap: 10px; }
.right-align { text-align: right; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-bottom: 10px; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

@media (max-width: 860px) {
  .wrap { padding: 22px 16px 70px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .brand-sub { display: none; }
  .nav a, .nav button { padding: 8px 9px; font-size: 13px; }
  .grid-2, .row-2, .row-3 { grid-template-columns: 1fr; }
  .actionbar { margin: 22px -16px -70px; padding: 12px 16px; }
  .frame { height: 420px; }
  h1 { font-size: 21px; }
}
