/* Notaris Rony Fauzi - stylesheet aplikasi (berasal dari mockup v2). */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e3e7ee;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #1e3a5f;
  --primary-600: #274b78;
  --accent: #b8893b;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #a16207;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --info: #1d4ed8;
  --info-bg: #dbeafe;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary-600); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  transition: transform .2s ease;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px; border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
}
.brand .logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.brand small { display: block; color: #94a3b8; font-size: 11px; }
.nav { padding: 12px 10px; flex: 1; }
.nav .label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7c8ba1; padding: 12px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: #cbd5e1; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar .foot { padding: 16px 20px; font-size: 12px; color: #7c8ba1; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar .left { display: flex; align-items: center; gap: 12px; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb b { color: var(--text); font-weight: 600; }
.user { display: flex; align-items: center; gap: 10px; position: relative; cursor: pointer; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-600); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.user .meta { line-height: 1.2; }
.user .meta small { color: var(--muted); display: block; font-size: 12px; }
.dropdown {
  display: none; position: absolute; right: 0; top: 46px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); min-width: 170px; padding: 6px;
}
.dropdown.open { display: block; }
.dropdown a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.dropdown a:hover { background: var(--bg); }
.burger { display: none; background: none; border: 0; cursor: pointer; padding: 6px; color: var(--text); }
.burger svg { width: 22px; height: 22px; display: block; }

.content { padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; }
.card-body { padding: 20px; }

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

.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat .ico svg { width: 22px; height: 22px; }
.stat .num { font-size: 24px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.stat .trend { font-size: 12px; color: var(--success); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px;
  padding: 9px 14px; font: inherit; font-weight: 500; cursor: pointer;
  background: var(--surface); color: var(--text); border-color: var(--border);
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-600); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn svg { width: 16px; height: 16px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.input, .select, textarea.input {
  font: inherit; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
  background: var(--surface); outline: none; width: 100%;
}
.input:focus, .select:focus { border-color: var(--primary-600); box-shadow: 0 0 0 3px rgba(39, 75, 120, .15); }
.toolbar .input { width: 240px; }
.toolbar .select { width: auto; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.req { color: var(--danger); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f9fafb; font-weight: 600; }
tbody tr:hover { background: #fafbfc; }
td .sub { display: block; color: var(--muted); font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 28px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.b-success { background: var(--success-bg); color: var(--success); }
.b-warning { background: var(--warning-bg); color: var(--warning); }
.b-danger  { background: var(--danger-bg);  color: var(--danger); }
.b-info    { background: var(--info-bg);    color: var(--info); }
.b-muted   { background: #eef0f3; color: var(--muted); }

.pagination { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; color: var(--muted); font-size: 13px; }
.pagination .pages { display: flex; gap: 4px; }
.pagination .pages span { min-width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.pagination .pages span.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 20px; }
.tabs button { background: none; border: 0; padding: 14px 12px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--primary); border-color: var(--primary); font-weight: 600; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-info { background: var(--info-bg); color: var(--info); }

/* Bar chart sederhana */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-top: 10px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .stack { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; }
.bars .stack i { display: block; }
.bars .col small { color: var(--muted); font-size: 12px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 14px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: var(--c); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.list small { color: var(--muted); display: block; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.open { display: flex; }
.modal-box { background: var(--surface); border-radius: 12px; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }

.detail { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; font-weight: 500; }

/* Toast */
.toast { position: fixed; right: 20px; bottom: 20px; background: #111827; color: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: .2s; z-index: 60; }
.toast.show { opacity: 1; transform: none; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side {
  background: linear-gradient(150deg, var(--primary) 0%, #0f2440 100%);
  color: #e2e8f0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side h1 { font-size: 30px; color: #fff; line-height: 1.3; margin: 16px 0 12px; }
.auth-side ul { padding-left: 18px; color: #cbd5e1; line-height: 1.9; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 22px; }
.auth-form p.muted { color: var(--muted); margin: 6px 0 24px; }
.auth-form .field { margin-bottom: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 13px; }
.error { color: var(--danger); font-size: 12px; margin-top: 4px; display: none; }

/* ---------- v2: role, alur, inline edit ---------- */
.role-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.r-superadmin { background: #ede9fe; color: #6d28d9; }
.r-admin { background: var(--info-bg); color: var(--info); }
.r-direksi { background: var(--warning-bg); color: var(--warning); }
.r-user { background: var(--success-bg); color: var(--success); }
.dropdown { min-width: 230px; }
.dropdown .dd-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 10px 2px; }
.dropdown a small { display: block; color: var(--muted); font-size: 11px; }
.dropdown a.on { background: var(--bg); font-weight: 600; }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

.forbidden { max-width: 460px; margin: 40px auto; padding: 36px; text-align: center; }
.forbidden svg { width: 44px; height: 44px; color: var(--danger); }
.forbidden h2 { margin: 10px 0 6px; }
.forbidden p { color: var(--muted); margin: 0 0 18px; }

.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert { display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

.modules { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.module { padding: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--text); transition: .15s; }
.module:hover { border-color: var(--primary-600); transform: translateY(-2px); }
.module .ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; }
.module .ico svg { width: 22px; height: 22px; }
.module h3 { font-size: 16px; }
.module p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.module .num { font-size: 22px; font-weight: 700; }
.module.disabled { opacity: .6; }

.flow { display: flex; gap: 0; align-items: stretch; overflow-x: auto; padding: 4px 0; }
.flow .step { flex: 1; min-width: 130px; text-align: center; position: relative; padding: 0 8px; }
.flow .step .n { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; font-weight: 700; font-size: 16px; background: var(--info-bg); color: var(--info); position: relative; z-index: 1; }
.flow .step:not(:last-child)::after { content: ""; position: absolute; top: 23px; left: calc(50% + 23px); right: calc(-50% + 23px); border-top: 2px dashed var(--border); }
.flow .step b { display: block; font-size: 13px; }
.flow .step small { color: var(--muted); font-size: 12px; }

.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 12px; align-items: end; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.filters .field label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

th.chk, td.chk { width: 36px; padding-right: 0; }
.row-actions { display: flex; gap: 6px; }
.bulkbar { display: none; align-items: center; gap: 10px; padding: 10px 20px; background: var(--info-bg); color: var(--info); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.bulkbar.show { display: flex; }
.bulkbar .select { width: auto; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #166534; }
.btn-link { background: none; border: 0; color: var(--primary-600); padding: 0; cursor: pointer; font: inherit; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.file-chip { display: inline-block; vertical-align: middle; font-size: 12px; color: var(--primary-600); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }
td input.input, td select.select { padding: 5px 8px; font-size: 13px; min-width: 120px; }
tr.editing { background: #fffbeb !important; }
tr.err-row { background: #fef2f2; }
.check-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.check-row + .check-row { margin-top: 8px; }
.capture-preview { margin-top: 8px; max-height: 160px; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; display: none; }
.modal-box.lg { max-width: 920px; }
.summary { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.summary b { color: var(--text); }

.doc { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 32px 40px; font-family: "Times New Roman", Georgia, serif; font-size: 15px; line-height: 1.7; color: #111; }
.doc h2 { text-align: center; font-size: 17px; text-transform: uppercase; margin-bottom: 2px; }
.doc .no { text-align: center; margin-bottom: 18px; }
.doc p { margin: 0 0 10px; text-align: justify; }
.doc .ttd { display: grid; grid-template-columns: 1fr 1fr; text-align: center; margin-top: 40px; gap: 20px; }
.doc .ttd div { padding-top: 70px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .burger { display: block; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .user .meta { display: none; }
}
@media (max-width: 560px) {
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar .input { width: 100%; }
  .detail { grid-template-columns: 1fr; gap: 2px; }
  .detail dd { margin-bottom: 8px; }
}
@media (max-width: 1100px) {
  .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .modules, .filters { grid-template-columns: 1fr; }
  .doc { padding: 20px; }
}
.toast.err { background: var(--danger); }
td.wrap { white-space: normal; min-width: 180px; max-width: 200px; overflow-wrap: anywhere; }

/* ---------- Mobile fixes ---------- */
.grid > * { min-width: 0; }               /* kartu tidak ikut melebar mengikuti tabel */
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-preview { grid-template-columns: 1fr 1.6fr; align-items: start; }
.sidebar-backdrop { display: none; }
@media (max-width: 1100px) {
  .grid-2, .grid-preview { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar.open + .sidebar-backdrop, .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 25; }
  .sidebar.open { box-shadow: 0 0 24px rgba(0,0,0,.25); }
}
@media (max-width: 560px) {
  .page-head { align-items: stretch; }
  .page-head > .toolbar, .page-head > .btn { width: 100%; }
  .page-head .toolbar .btn { flex: 1; justify-content: center; }
  .page-head h1 { font-size: 22px; }
  .card-head { padding: 14px 16px; }
  .card-head .toolbar { width: 100%; }
  .card-head .toolbar .select { flex: 1; }
  .card-body { padding: 16px; }
  .tabs { padding: 0 8px; overflow-x: auto; }
  .filters { padding: 14px 16px; }
  .summary { padding: 10px 16px; gap: 6px 14px; }
  .bulkbar { padding: 10px 16px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { max-height: 94vh; border-radius: 14px 14px 0 0; }
  .modal-foot .btn { flex: 1; justify-content: center; }
  .doc { font-size: 14px; padding: 18px; }
  .doc .ttd { grid-template-columns: 1fr; }
  .flow .step { min-width: 110px; }
  .stat .num { font-size: 20px; }
  .user .dropdown { position: fixed; right: 8px; top: 58px; max-width: calc(100vw - 16px); }
  .toast { left: 16px; right: 16px; bottom: 16px; }
  .pagination { flex-direction: column; gap: 8px; }
}

/* ===== Laravel app additions ===== */
.dropdown form { margin: 0; }
.dropdown button { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.dropdown button:hover, .dropdown button.on { background: var(--bg); }
.dropdown button.on { font-weight: 600; }
.dropdown button small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.pager div { display: flex; gap: 6px; }
.pager [aria-disabled] { opacity: .45; pointer-events: none; }
.field .error-text { color: var(--danger); font-size: 12px; margin-top: 4px; }
.inline-form { display: inline; margin: 0; }
a.file-chip { color: inherit; text-decoration: none; }
a.file-chip:hover { text-decoration: underline; }
.placeholder-list { columns: 2; font-size: 12px; margin: 8px 0 0; padding-left: 18px; }
.placeholder-list code { background: var(--bg); padding: 1px 4px; border-radius: 4px; }
@media (max-width: 560px) { .placeholder-list { columns: 1; } }
@media print {
  .sidebar, .topbar, .sidebar-backdrop, .page-head .toolbar, .no-print { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
}
[hidden] { display: none !important; }
#tblMinuta .row-actions { flex-wrap: wrap; max-width: 230px; }
#tblMinuta td .input[type=date] { display: block; }
#tblMinuta .row-actions .btn svg:only-child { margin: 0; }
