
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root, [data-theme="light"] {
  /* ── Brand ── */
  --color-primary: #000000;
  --color-primary-hover: #1a1a1a;
  --color-primary-active: #333333;
  --color-primary-foreground: #ffffff;
  --color-secondary: #f5f5f5;
  --color-secondary-hover: #ebebeb;
  --color-secondary-active: #e0e0e0;
  --color-secondary-foreground: #000000;
  --color-accent: #666666;
  --color-accent-foreground: #ffffff;

  /* ── Background ── */
  --color-background: #ffffff;
  --color-surface: #ffffff;
  --color-surface-variant: #fafafa;
  --color-surface-hover: #f5f5f5;
  --color-surface-active: #eeeeee;

  /* ── Text ── */
  --color-text: #111111;
  --color-text-secondary: #444444;
  --color-text-muted: #777777;
  --color-text-disabled: #aaaaaa;
  --color-text-placeholder: #999999;

  /* ── Border ── */
  --color-border: #dddddd;
  --color-border-light: #eeeeee;
  --color-border-strong: #bbbbbb;
  --border-width: 0.5px;

  /* ── Divider ── */
  --color-divider: #eeeeee;

  /* ── Status ── */
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-info: #2563eb;
  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;

  /* ── Input ── */
  --color-input: #ffffff;
  --color-input-border: #dcdcdc;
  --color-input-focus: #000000;
  --color-input-placeholder: #999999;

  /* ── Card ── */
  --color-card: #ffffff;
  --color-card-border: #e5e5e5;

  /* ── Sidebar ── */
  --color-sidebar: #ffffff;
  --color-sidebar-border: #eeeeee;
  --color-sidebar-item-hover: #f5f5f5;
  --color-sidebar-item-active: #eeeeee;
  --color-sidebar-item-active-text: #111111;

  /* ── Topbar ── */
  --color-topbar: #ffffff;
  --color-topbar-border: #eeeeee;

  /* ── Table ── */
  --color-table: #ffffff;
  --color-table-header: #fafafa;
  --color-table-row-hover: #f8f8f8;
  --color-table-border: #e5e5e5;

  /* ── Modal ── */
  --color-modal: #ffffff;
  --color-modal-overlay: rgba(0, 0, 0, 0.4);

  /* ── Button ── */
  --color-button-primary: #000000;
  --color-button-primary-hover: #222222;
  --color-button-primary-text: #ffffff;
  --color-button-secondary: #ffffff;
  --color-button-secondary-hover: #f5f5f5;
  --color-button-secondary-text: #111111;
  --color-button-secondary-border: #dddddd;

  /* ── Focus ── */
  --color-focus-ring: rgba(0, 0, 0, 0.2);

  /* ── Global border ── */
  --border-thin: 0.5px solid var(--color-border);
  --border-light: 0.5px solid var(--color-border-light);
  --border-strong: 0.5px solid var(--color-border-strong);

  /* ── Layout ── */
  --sidebar-width: 250px;
  --navbar-height: 64px;

  /* ── Legacy aliases ── */
  --sidebar-bg: var(--color-sidebar);
  --sidebar-hover: var(--color-sidebar-item-hover);
  --sidebar-active: var(--color-sidebar-item-active);
  --sidebar-text: var(--color-text-secondary);
  --sidebar-text-active: var(--color-sidebar-item-active-text);
  --primary: var(--color-primary);
  --success: var(--color-success);
  --warning: var(--color-warning);
  --danger: var(--color-danger);
  --info: var(--color-info);
  --border: var(--color-border);
  --body-bg: var(--color-background);
  --card-bg: var(--color-card);
  --header-bg: var(--color-topbar);
  --header-text: var(--color-text);
  --header-desc: var(--color-text-muted);
  --text-body: var(--color-text);
  --text-muted: var(--color-text-muted);
  --text-secondary: var(--color-text-secondary);
  --rp-bg: var(--color-surface);
  --rp-bg-light: var(--color-surface-variant);
  --rp-bg-success: var(--color-success-bg);
  --rp-bg-warning: var(--color-warning-bg);
  --rp-bg-primary: var(--color-info-bg);
  --rp-bg-danger: var(--color-danger-bg);
  --rp-bg-final: var(--color-success-bg);
  --rp-border: var(--color-border);
  --rp-border-form: var(--color-input-border);
  --rp-text: var(--color-text);
  --rp-text-muted: var(--color-text-muted);
  --rp-text-danger: var(--color-danger);
  --rp-th-bg: var(--color-table-header);
}
[data-theme="dark"] {
  /* ── Brand ── */
  --color-primary: #ffffff;
  --color-primary-hover: #eeeeee;
  --color-primary-active: #dddddd;
  --color-primary-foreground: #000000;
  --color-secondary: #1a1a1a;
  --color-secondary-hover: #222222;
  --color-secondary-active: #2a2a2a;
  --color-secondary-foreground: #ffffff;
  --color-accent: #aaaaaa;
  --color-accent-foreground: #000000;

  /* ── Background ── */
  --color-background: #000000;
  --color-surface: #0a0a0a;
  --color-surface-variant: #111111;
  --color-surface-hover: #181818;
  --color-surface-active: #222222;

  /* ── Text ── */
  --color-text: #ffffff;
  --color-text-secondary: #cccccc;
  --color-text-muted: #888888;
  --color-text-disabled: #555555;
  --color-text-placeholder: #666666;

  /* ── Border ── */
  --color-border: #2a2a2a;
  --color-border-light: #1c1c1c;
  --color-border-strong: #444444;
  --border-width: 0.5px;

  /* ── Divider ── */
  --color-divider: #222222;

  /* ── Status ── */
  --color-success: #4ade80;
  --color-success-bg: #0a1f12;
  --color-success-border: #14532d;
  --color-warning: #fbbf24;
  --color-warning-bg: #211a05;
  --color-warning-border: #713f12;
  --color-danger: #f87171;
  --color-danger-bg: #210a0a;
  --color-danger-border: #7f1d1d;
  --color-info: #60a5fa;
  --color-info-bg: #0a1626;
  --color-info-border: #1e3a5f;

  /* ── Input ── */
  --color-input: #0a0a0a;
  --color-input-border: #333333;
  --color-input-focus: #ffffff;
  --color-input-placeholder: #666666;

  /* ── Card ── */
  --color-card: #0a0a0a;
  --color-card-border: #222222;

  /* ── Sidebar ── */
  --color-sidebar: #050505;
  --color-sidebar-border: #222222;
  --color-sidebar-item-hover: #151515;
  --color-sidebar-item-active: #121212;
  --color-sidebar-item-active-text: #eeeeee;

  /* ── Topbar ── */
  --color-topbar: #000000;
  --color-topbar-border: #222222;

  /* ── Table ── */
  --color-table: #000000;
  --color-table-header: #0a0a0a;
  --color-table-row-hover: #111111;
  --color-table-border: #222222;

  /* ── Modal ── */
  --color-modal: #0a0a0a;
  --color-modal-overlay: rgba(0, 0, 0, 0.7);

  /* ── Button ── */
  --color-button-primary: #ffffff;
  --color-button-primary-hover: #eeeeee;
  --color-button-primary-text: #000000;
  --color-button-secondary: #0a0a0a;
  --color-button-secondary-hover: #181818;
  --color-button-secondary-text: #ffffff;
  --color-button-secondary-border: #333333;

  /* ── Focus ── */
  --color-focus-ring: rgba(255, 255, 255, 0.25);

  /* ── Global border ── */
  --border-thin: 0.5px solid var(--color-border);
  --border-light: 0.5px solid var(--color-border-light);
  --border-strong: 0.5px solid var(--color-border-strong);

  /* ── Legacy aliases ── */
  --sidebar-bg: var(--color-sidebar);
  --sidebar-hover: var(--color-sidebar-item-hover);
  --sidebar-active: var(--color-sidebar-item-active);
  --sidebar-text: var(--color-text-secondary);
  --sidebar-text-active: var(--color-sidebar-item-active-text);
  --primary: var(--color-primary);
  --success: var(--color-success);
  --warning: var(--color-warning);
  --danger: var(--color-danger);
  --info: var(--color-info);
  --border: var(--color-border);
  --body-bg: var(--color-background);
  --card-bg: var(--color-card);
  --header-bg: var(--color-topbar);
  --header-text: var(--color-text);
  --header-desc: var(--color-text-muted);
  --text-body: var(--color-text);
  --text-muted: var(--color-text-muted);
  --text-secondary: var(--color-text-secondary);
  --rp-bg: var(--color-surface);
  --rp-bg-light: var(--color-surface-variant);
  --rp-bg-success: var(--color-success-bg);
  --rp-bg-warning: var(--color-warning-bg);
  --rp-bg-primary: var(--color-info-bg);
  --rp-bg-danger: var(--color-danger-bg);
  --rp-bg-final: var(--color-success-bg);
  --rp-border: var(--color-border);
  --rp-border-form: var(--color-input-border);
  --rp-text: var(--color-text);
  --rp-text-muted: var(--color-text-muted);
  --rp-text-danger: var(--color-danger);
  --rp-th-bg: var(--color-table-header);
}

html { transition: background .2s, color .2s; }
*, ::after, ::before { box-sizing: border-box; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.35); }

html, body {
  height: 100%; margin: 0; padding: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: -1px; 
  background: var(--body-bg);
  color: var(--text-body);
  overflow: hidden;
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
input, textarea, select, [contenteditable] { -webkit-user-select: auto; user-select: auto; }

/* ── LAYOUT ── */
.wrapper { display: flex; min-height: 100vh; }

.main-header {
  position: fixed; top: 0; left: var(--sidebar-width); right: 0;
  height: var(--navbar-height); z-index: 1030;
  background: var(--header-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  transition: left .2s ease;
}

.main-sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-width); height: 100vh; z-index: 1031;
  background: var(--sidebar-bg);
  border-right: 0.5px solid var(--color-sidebar-border);
  transition: width .2s ease;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.content-wrapper {
  margin-top: var(--navbar-height);
  margin-left: var(--sidebar-width);
  flex: 1;
  overflow-y: auto;
  height: calc(100vh - var(--navbar-height)) !important;
  transition: margin-left .2s ease;
}

/* ── SIDEBAR COLLAPSED ── */
.sidebar-collapse .main-header { left: 0; }
.sidebar-collapse .main-sidebar { width: 0; }
.sidebar-collapse .content-wrapper { margin-left: 0; }

/* ── HEADER ── */
.header-title {
  display: flex; align-items: center; gap: 8px;
}
.header-title-text { font-weight: 600; font-size: 18px; color: var(--header-text); line-height: 1.2; }
.header-title-desc { font-size: 12px; color: var(--header-desc); line-height: 1.2; margin-top: 1px; }
#sidebarToggle { display: inline-flex; align-items: center; color: var(--text-muted); }
#sidebarToggle:hover { color: var(--text-body); }

.header-toolbar {
  display: flex; align-items: center; gap: 6px;
}
.header-toolbar .search-form {
  display: flex; gap: 4px;
}
.header-toolbar .search-form .form-control {
  width: 200px; height: 32px; font-size: 12px; padding: 4px 8px;
}
.header-toolbar .search-form .btn {
  height: 32px; padding: 4px 8px; display: flex; align-items: center;
}
.header-toolbar .btn { height: 32px; font-size: 12px; display: flex; align-items: center; gap: 4px; }

/* ── BRAND ── */
.brand-link {
  display: flex; align-items: center; gap: 10px;
  min-height: 64px; padding: 8px 12px;
  color: var(--sidebar-text-active); text-decoration: none;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-link:hover { color: var(--sidebar-text-active); text-decoration: none; }
.brand-logo { flex-shrink: 0; display: flex; align-items: center; }
.brand-logo-wrap {
  position: relative; border-radius: 6px; overflow: hidden; line-height: 0; display: inline-block;
  background-size: cover; background-position: center;
}
.brand-logo-wrap::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: inherit; background-size: cover; background-position: center;
  filter: blur(6px); transform: scale(1.15); opacity: .55;
}
.brand-logo-wrap img {
  position: relative; z-index: 1; height: 40px; width: auto; display: block; border-radius: 6px;
  margin: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.brand-text { flex: 1; min-width: 0; line-height: 1.3; }
.brand-title { font-weight: 700; font-size: 13px; }
.brand-name { font-size: 11px; color: var(--sidebar-text); }
.brand-addr { font-size: 10px; color: var(--sidebar-text); opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── SIDEBAR NAV ── */
.sidebar { flex: 1; overflow-y: auto; padding: 0; }
.nav { list-style: none; padding: 0; margin: 0; display: block; }
.nav-link {
  display: flex; align-items: center;
  padding: 10px 10px; color: var(--sidebar-text);
  text-decoration: none; font-size: 13px;
  transition: background .15s, color .15s;
  width: 100%;
}
.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); text-decoration: none; }
.nav-link.active {
  background: var(--sidebar-active); color: var(--sidebar-text-active);
  box-shadow: inset 3px 0 0 var(--primary);
}
.nav-icon { flex-shrink: 0; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; margin-right: 8px; }
.nav-link .nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-label { padding: 14px 8px 4px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--sidebar-text); opacity: .5; cursor: default; width: 100%; }
.nav-treeview { list-style: none; padding: 0 0 2px; margin: 0; }
.nav-treeview .nav-icon { margin-left: 4px; margin-right: 10px; }
.nav-group .nav-toggle {
  display: flex; align-items: center; padding: 8px 12px 8px 8px; font-size: 13px;
  color: var(--sidebar-text); cursor: pointer;
}
.nav-group .nav-toggle:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); text-decoration: none; }
.nav-caret { margin-left: auto; transition: transform .2s ease; line-height: 0; }
.nav-toggle[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
.nav-group .nav-treeview.collapse:not(.show) { display: none; }
.nav-group .nav-treeview.collapse.show { display: block; }
.nav-icon-child { visibility: hidden; }

/* ── SIDEBAR FOOTER ── */
.sidebar-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--sidebar-bg);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  color: var(--sidebar-text); font-size: 12px;
  flex: 1; min-width: 0;
}
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-accent); color: var(--color-accent-foreground);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-jabatan { font-size: 9.5px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.sidebar-logout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--color-text-muted); text-decoration: none;
  transition: color .15s;
}
.sidebar-logout:hover { color: var(--danger); text-decoration: none; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--color-text-muted); text-decoration: none; cursor: pointer;
  transition: color .15s; background: none; border: none; font-size: 14px;
}
.theme-toggle:hover { color: var(--warning); }

/* ── CONTENT ── */
.content { padding: 12px 16px; }
.content.p-0 { padding: 0; }

/* ── CARDS (flat) ── */
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 0;
  margin-bottom: 12px;
}
form > .card { border: none; background: transparent; }
.card-header {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--rp-bg-light);
}
.card-header h3 { font-size: 13px; font-weight: 600; margin: 0; }
.card-body { padding: 12px; }
.card-body.p-0 { padding: 0; }

/* ── TABLES ── */
.table { margin-bottom: 0; font-size: 12px; color: var(--rp-text); }
.table th { font-weight: 600; border-bottom-width: 2px; padding: 6px 8px !important; }
.table td { padding: 6px 8px !important; vertical-align: middle; }

.table-container {
  overflow-y: auto;
  max-height: calc(100vh - var(--navbar-height) - 54px);
}
.table-container thead th {
  position: sticky; top: 0; background: var(--rp-bg); z-index: 1;
}

/* ── BUTTONS (flat) ── */
.btn { border-radius: 0; font-family: 'JetBrains Mono', monospace; font-size: 12px; border-width: 1px; border-style: solid; padding: 4px 10px; }
.btn-sm { border-radius: 0; padding: 2px 8px; font-size: 12px; }
.btn-primary { background: var(--color-button-primary); border-color: var(--color-button-primary); color: var(--color-button-primary-text); }
.btn-primary:hover { background: var(--color-button-primary-hover); border-color: var(--color-button-primary-hover); color: var(--color-button-primary-text); }
.btn-success { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.btn-warning { background: var(--color-warning); border-color: var(--color-warning); color: #fff; }
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-info { background: var(--color-info); border-color: var(--color-info); color: #fff; }
.btn-secondary { background: var(--color-button-secondary); border-color: var(--color-button-secondary-border); color: var(--color-button-secondary-text); }
.btn-light { background: var(--color-surface-variant); border-color: var(--color-border); color: var(--color-text); }
.btn-outline-secondary { border-color: var(--color-border); color: var(--color-text-muted); background: transparent; }
.btn:hover { filter: brightness(1.1); }
.btn:active { filter: brightness(.95); }
.btn svg { width: 14px; height: 14px; }

/* ── FORMS (flat) ── */
.form-control { border-radius: 0; font-family: 'JetBrains Mono', monospace; font-size: 13px; border-color: var(--rp-border); color: var(--rp-text); background: var(--rp-bg); }
.form-control::placeholder { color: var(--color-text-muted); opacity: .7; }
.form-control:focus { box-shadow: none; border-color: var(--primary); background: var(--rp-bg); }
.form-control[readonly] { background: var(--color-surface-variant); color: var(--color-text-muted); cursor: default; }
.form-control:disabled, .form-control[disabled] { background: var(--color-surface-variant); color: var(--color-text-disabled); cursor: not-allowed; opacity: 1; }
.form-group { margin-bottom: 10px; }
.form-group label { font-size: 12px; margin-bottom: 2px; font-weight: 500; }
select, input, textarea, button { font-size: 13px !important; }

/* ── ALERTS (flat) ── */
.alert { border-radius: 0; border: 1px solid transparent; padding: 8px 12px; margin-bottom: 12px; font-size: 12px; }
.alert-success { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success); }
.alert-danger { background: var(--color-danger-bg); border-color: var(--color-danger-border); color: var(--color-danger); }
.alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning); }
.alert-info { background: var(--color-info-bg); border-color: var(--color-info-border); color: var(--color-info); }

/* ── BADGES (flat) ── */
.badge { border-radius: 0; font-weight: 500; padding: 2px 6px; font-size: 10px; }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }
.badge-primary { background: var(--color-info-bg); color: var(--color-info); }

/* ── PAGINATION ── */
.pagination-wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 12px; font-size: 12px; color: var(--text-muted);
}
.pagination-wrap .page-link {
  border-radius: 0 !important; color: var(--text-body); border-color: var(--border);
  padding: 4px 8px; font-size: 12px; background: var(--color-surface);
}
.pagination-wrap .page-link:hover { background: var(--color-surface-hover); }
.pagination-wrap .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: var(--color-primary-foreground); }
.pagination-wrap .page-item.disabled .page-link { opacity: .4; pointer-events: none; }

[data-theme="dark"] .table-danger,
[data-theme="dark"] .table-danger > th,
[data-theme="dark"] .table-danger > td { background: var(--color-danger-bg); color: var(--color-danger); }
[data-theme="dark"] .table-warning,
[data-theme="dark"] .table-warning > th,
[data-theme="dark"] .table-warning > td { background: var(--color-warning-bg); color: var(--color-warning); }
[data-theme="dark"] .table-success,
[data-theme="dark"] .table-success > th,
[data-theme="dark"] .table-success > td { background: var(--color-success-bg); color: var(--color-success); }
[data-theme="dark"] .table-info,
[data-theme="dark"] .table-info > th,
[data-theme="dark"] .table-info > td { background: var(--color-info-bg); color: var(--color-info); }
[data-theme="dark"] .badge-success { background: var(--color-success-bg); color: var(--color-success); }
[data-theme="dark"] .badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
[data-theme="dark"] .badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
[data-theme="dark"] .badge-info { background: var(--color-info-bg); color: var(--color-info); }
[data-theme="dark"] .badge-primary { background: var(--color-info-bg); color: var(--color-info); }
[data-theme="dark"] .table th,
[data-theme="dark"] .table td { border-top-color: var(--color-border); }
[data-theme="dark"] .table thead th { border-bottom-color: var(--color-border); }
[data-theme="dark"] .table-bordered,
[data-theme="dark"] .table-bordered th,
[data-theme="dark"] .table-bordered td { border-color: var(--color-border); }

/* ── MODAL (flat) ── */
.modal-content { border-radius: 0; border: 1px solid var(--border); background: var(--rp-bg); color: var(--rp-text); }
.modal-header { border-bottom: 1px solid var(--border); padding: 10px 12px; }
.modal-footer { border-top: 1px solid var(--border); padding: 10px 12px; }
.modal-title { font-weight: 600; font-size: 14px; }
.close { font-size: 1.2rem; }

/* ── LOGIN ── */
.login-page {
  display: flex; flex-direction: row; min-height: 100vh;
  background: url('../img/background.jpeg') center/cover no-repeat fixed;
}
.login-splash {
  width: calc(100vw - 360px); position: relative; overflow: hidden;
}
.login-splash-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(160deg,
    rgba(0,0,0,.7) 0%, rgba(0,0,0,.45) 30%,
    rgba(0,0,0,.15) 55%, transparent 75%
  );
}
.login-splash-content {
  position: absolute; bottom: 32px; left: 32px; z-index: 2;
  display: flex; align-items: center; gap: 16px;
}
.login-splash-logo img { height: 48px; width: auto; }
.login-splash-info { color: #fff; font-size: 14px; line-height: 1.5; opacity: .9; }
.login-splash-motivasi {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 2;
  color: #fff; font-size: 18px; font-style: italic; text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,.5); max-width: 600px; line-height: 1.6;
}
.login-box {
  width: 360px; min-width: 360px; background: rgba(255,255,255,.75); border: none;
  display: flex; flex-direction: column; justify-content: center; padding: 32px;
}
[data-theme="dark"] .login-box { background: rgba(30,30,40,.8); }
.login-box h4 { font-weight: 600; margin-bottom: 24px; text-align: center; }

/* ── TABLE ACTIONS (show on hover) ── */
.table-actions { white-space: nowrap; width: 70px; text-align: center; }
.table-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; vertical-align: middle;
  color: var(--text-secondary); text-decoration: none; transition: color .15s;
  opacity: 0;
}
.table-action:hover { color: var(--text-body); background: none; border-left: none; }
.table-action svg { width: 14px; height: 14px; }
td:has(.table-action) { white-space: nowrap; }
.table tbody tr:hover .table-action { opacity: 1; }
[data-theme="dark"] .table tbody tr:hover { background: rgba(255,255,255,.04); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .main-sidebar { width: 0; }
  .main-header { left: 0; }
  .content-wrapper { margin-left: 0; }
  .sidebar-open .main-sidebar { width: var(--sidebar-width); }
  .sidebar-open .main-header { left: var(--sidebar-width); }
  .sidebar-open .content-wrapper { margin-left: var(--sidebar-width); }
  .sidebar-open .overlay { display: block; }
  .header-toolbar .search-form .form-control { width: 130px; }
}

@media (min-width: 769px) {
  #sidebarToggle { display: none; }
}

/* ── TABS (flat) ── */
.nav-tabs { border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.nav-tabs .nav-link {
  border-radius: 0; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-size: 12px; font-weight: 500; padding: 6px 12px;
  background: transparent; transition: color .15s, border-color .15s;
}
.nav-tabs .nav-link:hover { color: var(--text-body); border-color: transparent; }
.nav-tabs .nav-link.active {
  color: var(--primary); border-bottom-color: var(--primary); background: transparent;
}
.tab-content { padding: 0; }

/* ── INLINE FORM (PHPMaker style) ── */
.icustom { padding-left: 0 !important; padding-right: 8px !important; }
.icustom .form-control { width: 100%; }
.ew-label { text-align: right; font-size: 12px; font-weight: 500; padding-top: 6px; }

@media (max-width: 576px) {
  .ew-label { text-align: left; }
  .icustom { padding-left: 15px !important; padding-right: 15px !important; }
}

/* ── ADDRESS CARD ── */
.form-group-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 16px; }
.form-group-row .form-group { margin-bottom: 12px; }
.form-group-row .address-card { margin-bottom: 0; }

.address-card { border: 1px solid var(--border); background: var(--rp-bg); cursor: pointer; transition: border-color .15s; margin-bottom: 10px; }
.address-card:hover { border-color: var(--primary); }
.address-card-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: var(--rp-bg-light); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 500; }
.address-card-edit { display: inline-flex; align-items: center; color: var(--text-secondary); cursor: pointer; }
.address-card-edit:hover { color: var(--primary); }
.address-card-edit svg { width: 14px; height: 14px; }
.address-card-body { padding: 10px; font-size: 12px; color: var(--text-body); line-height: 1.5; min-height: 36px; word-break: break-word; }

/* ── COA MASTER-DETAIL ── */
.coa-grid { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - var(--navbar-height)); }
.coa-tree { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--rp-bg); }
.coa-tree-toolbar { padding: 8px 12px 6px; border-bottom: 1px solid var(--border); }
.coa-search-wrap { margin-bottom: 6px; }
.coa-search-wrap .form-control-sm { font-size: 12px; }
.coa-chip-group { display: flex; gap: 4px; }
.coa-chip {
  display: inline-block; padding: 3px 10px; font-size: 10px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-muted); text-decoration: none;
  transition: all .15s; cursor: pointer;
}
.coa-chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.coa-chip.active { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-foreground); }
.coa-tree-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 4px 0; }
.coa-tree details { margin: 0; }
.coa-tree summary { padding: 5px 16px 5px 28px; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text-body); list-style: none; display: flex; align-items: center; gap: 4px; }
.coa-tree summary::-webkit-details-marker { display: none; }
.coa-tree summary::before { content: '▸'; font-size: 10px; color: var(--text-secondary); transition: transform .15s; display: inline-block; width: 14px; }
.coa-tree details[open] > summary::before { transform: rotate(90deg); }
.coa-l1[open] > summary { color: var(--primary); }
.coa-l2 summary { padding-left: 44px; font-weight: 400; font-size: 11px; color: var(--text-muted); }
.coa-l2[open] > summary { color: var(--text-body); }
.coa-account { display: flex; justify-content: space-between; align-items: center; padding: 4px 16px 4px 60px; font-size: 11px; color: var(--text-muted); text-decoration: none; transition: background .1s, color .1s; }
.coa-account:hover { background: var(--rp-bg-light); color: var(--text-body); text-decoration: none; }
.coa-account.active { background: var(--rp-bg-primary); color: var(--primary); font-weight: 500; }
.coa-account-inactive { text-decoration: line-through; color: var(--rp-border); }
.coa-account.active .coa-account-inactive { color: var(--text-secondary); }
.coa-account-balance { font-size: 10px; color: var(--text-muted); }

.coa-detail { min-height: 0; background: var(--body-bg); }
.coa-detail-header { padding: 12px 16px; background: var(--rp-bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.coa-account-info { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.coa-detail-actions { display: flex; align-items: center; gap: 4px; }
.coa-detail-actions .btn { font-size: 11px; }
.coa-account-no { font-size: 14px; font-weight: 600; color: var(--text-body); }
.coa-account-name { font-size: 12px; color: var(--text-muted); }
.coa-account-drcr { font-size: 11px; color: var(--text-secondary); }
.coa-period-form { display: flex; align-items: center; gap: 6px; padding: 10px 16px; background: var(--rp-bg); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.coa-period-form label { margin: 0; font-size: 12px; font-weight: 500; white-space: nowrap; }
.coa-period-form .form-control-sm { width: 150px; font-size: 12px; }
.coa-period-sep { font-size: 12px; color: var(--text-secondary); }
.coa-period-form .btn { white-space: nowrap; }
.coa-saldo-box { padding: 8px 16px; background: var(--rp-bg-light); border-bottom: 1px solid var(--border); font-size: 12px; }
.coa-saldo-box strong { font-weight: 600; }
.coa-mutasi th { position: sticky; top: 0; background: var(--rp-bg); }
.coa-mutasi td, .coa-mutasi th { padding: 4px 8px !important; }
.coa-mutasi .text-right { text-align: right; }
.coa-empty { padding: 40px 16px; text-align: center; color: var(--text-secondary); font-size: 13px; }

@media (max-width: 768px) {
  .coa-grid { grid-template-columns: 1fr; }
  .coa-tree { max-height: 40vh; border-right: none; border-bottom: 1px solid var(--border); }
}

/* ── XSTATUS RADIO ── */
.xstatus-radio { display: flex; align-items: center; gap: 16px; padding-top: 4px; }
.xstatus-option { font-size: 12px; font-weight: 400; cursor: pointer; margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.xstatus-option input[type="radio"] { margin: 0; }

/* ── ANGSURAN FILTER ── */
.angsuran-wrap { display: flex; gap: 0; height: calc(100vh - var(--navbar-height)); }
.angsuran-sidebar {
  width: 280px; min-width: 280px; overflow-y: auto; border-right: 1px solid var(--border);
  background: var(--rp-bg); padding: 10px 12px;
}
.angsuran-sidebar label { font-size: 11px; margin-bottom: 2px; font-weight: 500; color: var(--text-body); }
.angsuran-sidebar .form-control { font-size: 11px; height: 28px; }
.angsuran-sidebar hr { margin: 8px 0; }
.angsuran-sidebar input[type=checkbox] { margin: 0; }
.angsuran-filter-section { margin-bottom: 10px; }
.angsuran-filter-section-title { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px; }
.angsuran-filter-scroll { max-height: 110px; overflow-y: auto; border: 1px solid var(--border); padding: 4px 6px; }
.angsuran-filter-scroll label { display: flex; align-items: center; gap: 4px; cursor: pointer; padding: 1px 0; }
.angsuran-filter-scroll label:hover { background: var(--rp-bg-light); }
.angsuran-chip-group { display: flex; flex-wrap: wrap; gap: 3px; }
.angsuran-chip {
  display: inline-block; padding: 2px 8px; font-size: 10px; font-weight: 500;
  border: 1px solid var(--color-border); color: var(--color-text-muted); cursor: pointer; transition: all .15s;
  user-select: none;
}
.angsuran-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.angsuran-chip.active { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-foreground); }
.angsuran-input { width: 60px; text-align: center; font-size: 12px; padding: 2px 4px; }
.angsuran-main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.angsuran-main .table-container { flex: 1; max-height: none; border-left: none; border-right: none; }

/* ── TABLE: remove all vertical borders ── */
.table-container .table-bordered { border-left: none; border-right: none; }
.table-container .table-bordered th,
.table-container .table-bordered td { border-left: none; border-right: none; }
.angsuran-footer { padding: 10px 12px; background: var(--color-surface); border-top: 1px solid var(--color-border); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.angsuran-footer label { font-size: 12px; margin: 0; font-weight: 500; white-space: nowrap; }
.angsuran-footer .form-control { font-size: 12px; height: 30px; }
.angsuran-footer .btn { white-space: nowrap; }
@media (max-width: 768px) {
  .angsuran-wrap { flex-direction: column; height: auto; }
  .angsuran-sidebar { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid var(--border); max-height: 300px; }
}

/* ── SMALL UTILITIES ── */
hr { border-color: var(--border); }

/* ── GLOBAL: right-align numbers ── */
td.text-right, th.text-right { text-align: right !important; }
input.format-uang { text-align: right; }

/* ── DASHBOARD STAT CARDS ── */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); gap:8px; }
.stat-card { position:relative; overflow:hidden; padding:16px; min-height:84px; background:var(--color-surface); }
.stat-bg-icon { position:absolute; right:-6px; bottom:-6px; opacity:0.1; pointer-events:none; line-height:0; }
.stat-bg-icon svg { width:68px; height:68px; }
.stat-content { position:relative; z-index:1; }
.stat-value { font-size:18px; font-weight:700; line-height:1.2; color:var(--text-body); }
.stat-label { font-size:10.5px; color:var(--text-muted); margin-top:2px; text-transform:uppercase; letter-spacing:0.3px; }

/* ── DASHBOARD CHARTS ── */
.chart-card .card-body { padding:12px; }
.chart-card .card-body h6 { font-size:12px; font-weight:600; margin-bottom:8px; }
.chart-tip { padding:6px 10px; font-size:12px; line-height:1.6; color:var(--color-text); background:var(--color-surface); border-radius:4px; }
.chart-tip strong { color:var(--color-text); }
.chart-tip b { font-weight:600; }
.dashboard-filter { display:flex; align-items:center; gap:6px; }
.dashboard-filter select, .dashboard-filter input { font-size:12px; padding:2px 6px; height:28px; border:1px solid var(--rp-border-form); border-radius:3px; background:var(--color-surface); color:var(--color-text); }
.dashboard-filter input { width:125px; }
.dashboard-filter .btn { font-size:11px; padding:2px 8px; height:28px; }

/* ── PRINT: force light theme ── */
@media print {
    :root, [data-theme="dark"] {
        --color-primary: #000000;
        --color-primary-foreground: #ffffff;
        --color-secondary: #f5f5f5;
        --color-secondary-foreground: #000000;
        --color-background: #ffffff;
        --color-surface: #ffffff;
        --color-surface-variant: #fafafa;
        --color-surface-hover: #f5f5f5;
        --color-text: #111111;
        --color-text-secondary: #444444;
        --color-text-muted: #777777;
        --color-border: #dddddd;
        --color-border-light: #eeeeee;
        --color-border-strong: #bbbbbb;
        --color-divider: #eeeeee;
        --color-sidebar: #ffffff;
        --color-sidebar-item-active: #eeeeee;
        --color-sidebar-item-active-text: #111111;
        --color-topbar: #ffffff;
        --color-card: #ffffff;
        --color-input: #ffffff;
        --color-table: #ffffff;
        --color-table-header: #fafafa;
        --color-modal: #ffffff;
        --color-button-primary: #000000;
        --color-button-primary-text: #ffffff;
        --color-button-secondary: #ffffff;
        --color-button-secondary-text: #111111;
        --color-button-secondary-border: #dddddd;
        --border-thin: 0.5px solid #dddddd;
        --border-light: 0.5px solid #eeeeee;
        --border-strong: 0.5px solid #bbbbbb;
        --sidebar-bg: var(--color-sidebar);
        --sidebar-text: var(--color-text-secondary);
        --sidebar-text-active: var(--color-sidebar-item-active-text);
        --body-bg: var(--color-background);
        --card-bg: var(--color-card);
        --header-bg: var(--color-topbar);
        --header-text: var(--color-text);
        --header-desc: var(--color-text-muted);
        --text-body: var(--color-text);
        --text-muted: var(--color-text-muted);
        --text-secondary: var(--color-text-secondary);
        --border: var(--color-border);
        --primary: var(--color-primary);
        --rp-bg: var(--color-surface);
        --rp-bg-light: var(--color-surface-variant);
        --rp-border: var(--color-border);
        --rp-border-form: var(--color-input-border);
        --rp-text: var(--color-text);
        --rp-text-muted: var(--color-text-muted);
        --rp-th-bg: var(--color-table-header);
    }
}
