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

:root {
  /* Inspira brand */
  --brand-50: #e8eef8;
  --brand-100: #bdd0ef;
  --brand-200: #7aa3de;
  --brand-400: #2e6abf;
  --brand-500: #1a56a8;
  --brand-600: #154490;
  --brand-700: #0f3270;
  --brand-800: #0b2558;
  --brand-900: #071840;
  --brand-accent: #f5a623;
  --brand-accent-dark: #d48d10;

  /* Keep green for UI accents */
  --green-50: #edf7ff;
  --green-100: #c6dff7;
  --green-200: #7aa3de;
  --green-500: #1a56a8;
  --green-600: #154490;
  --green-700: #0f3270;
  --green-900: #071840;

  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-150: #e8eaed;
  --gray-200: #dde1e7;
  --gray-300: #c4cad4;
  --gray-400: #9aa3b2;
  --gray-500: #6b7890;
  --gray-600: #4a5568;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --amber-50: #fdf8ee;
  --amber-100: #faeac6;
  --amber-500: #d4890a;
  --amber-600: #a06605;

  --red-50: #fef3f2;
  --red-100: #fdd9d7;
  --red-500: #e03e2d;
  --red-600: #b53025;

  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #2563eb;
  --blue-600: #1d4ed8;

  --sidebar-w: 256px;
  --topbar-h: 60px;
  --font: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.1), 0 4px 8px rgba(0,0,0,.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

html { font-size: 15px; }
body { font-family: var(--font); background: var(--gray-100); color: var(--gray-900); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* ── APP SHELL ── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--brand-900);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; overflow: hidden; }
.brand-name { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 10px; font-weight: 400; color: var(--brand-accent); letter-spacing: .3px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.sidebar-close { display: none; background: none; border: none; color: rgba(255,255,255,.5); cursor: pointer; padding: 4px; border-radius: 6px; transition: color .15s, background .15s; }
.sidebar-close:hover { color: #fff; background: rgba(255,255,255,.08); }

.compose-btn-wrap { padding: 16px 14px 8px; }
.compose-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: var(--brand-accent);
  color: #fff;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.1px;
  transition: background .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(245,166,35,.35);
}
.compose-btn:hover { background: #f0b835; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,166,35,.45); }
.compose-btn:active { transform: translateY(0); }

.sidebar-nav { flex: 1; padding: 4px 10px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  margin-bottom: 1px;
  transition: all .15s;
  position: relative;
}
.nav-item:hover { color: rgba(255,255,255,.9); background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.12); font-weight: 500; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 25%; height: 50%; width: 3px; background: var(--brand-accent); border-radius: 0 3px 3px 0; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { opacity: 1; }
.nav-divider { height: 1px; background: rgba(255,255,255,.06); margin: 8px 4px; }

.badge { margin-left: auto; background: var(--brand-accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.badge-muted { background: rgba(255,255,255,.12); color: rgba(255,255,255,.6); }

.sidebar-footer { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 34px; height: 34px; background: var(--brand-600); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; flex-shrink: 0; border: 2px solid rgba(255,255,255,.15); }
.user-details { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 11px; color: rgba(255,255,255,.45); }
.user-menu-btn { background: none; border: none; color: rgba(255,255,255,.4); cursor: pointer; padding: 4px; border-radius: 4px; transition: color .15s; }
.user-menu-btn:hover { color: rgba(255,255,255,.7); }

/* ── OVERLAY ── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; backdrop-filter: blur(2px); }

/* ── MAIN CONTENT ── */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; overflow: hidden; }

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-150);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.hamburger { display: none; background: none; border: none; color: var(--gray-600); cursor: pointer; padding: 6px; border-radius: 8px; transition: background .15s; }
.hamburger:hover { background: var(--gray-100); }

.topbar-search { flex: 1; max-width: 480px; position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--gray-400); }
.search-input {
  width: 100%;
  padding: 8px 40px 8px 36px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--gray-900);
  background: var(--gray-50);
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
}
.search-input::placeholder { color: var(--gray-400); }
.search-input:focus { border-color: var(--brand-500); background: #fff; box-shadow: 0 0 0 3px rgba(26,86,168,.1); }
.search-kbd { position: absolute; right: 10px; font-family: var(--mono); font-size: 11px; color: var(--gray-400); background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 4px; padding: 1px 5px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-btn { position: relative; background: none; border: none; color: var(--gray-500); cursor: pointer; padding: 7px; border-radius: 8px; transition: background .15s, color .15s; }
.topbar-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; background: var(--red-500); border-radius: 50%; border: 2px solid #fff; }
.topbar-avatar { width: 32px; height: 32px; background: var(--brand-700); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; color: #fff; cursor: pointer; }

/* ── PAGE BODY ── */
.page-body { flex: 1; overflow-y: auto; padding: 24px; }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title-group {}
.page-breadcrumb { font-size: 12px; color: var(--gray-400); margin-bottom: 2px; }
.page-breadcrumb a { color: var(--brand-500); text-decoration: none; }
.page-title { font-size: 22px; font-weight: 600; color: var(--gray-900); letter-spacing: -.4px; }
.page-subtitle { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; }

/* ── STATS BAR ── */
.stats-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--gray-150); border-radius: var(--radius-md); padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon.green { background: var(--brand-50); color: var(--brand-500); }
.stat-icon.amber { background: var(--amber-50); color: var(--amber-600); }
.stat-icon.red { background: var(--red-50); color: var(--red-500); }
.stat-icon.blue { background: var(--blue-50); color: var(--blue-600); }
.stat-label { font-size: 11.5px; color: var(--gray-500); font-weight: 400; line-height: 1.2; }
.stat-value { font-size: 20px; font-weight: 600; color: var(--gray-900); letter-spacing: -.5px; line-height: 1; }

/* ── MAIL LIST ── */
.mail-list-wrap { background: #fff; border: 1px solid var(--gray-150); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.mail-list-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--gray-100); }
.mail-list-title { font-size: 13px; font-weight: 500; color: var(--gray-600); }
.filter-tabs { display: flex; gap: 4px; }
.filter-tab { padding: 5px 12px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 400; color: var(--gray-500); border: none; background: none; cursor: pointer; transition: all .15s; }
.filter-tab.active, .filter-tab:hover { background: var(--brand-50); color: var(--brand-600); font-weight: 500; }

/* ── Filter Dropdown ── */
.filter-wrap { position: relative; }
.filter-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  color: var(--gray-600); border: 1px solid var(--gray-200); background: #fff;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.filter-btn:hover { border-color: var(--brand-400); color: var(--brand-600); }
.filter-btn.has-filter { border-color: var(--brand-500); color: var(--brand-600); background: var(--brand-50); }
.filter-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%; font-size: 10px; font-weight: 700;
  background: var(--brand-600); color: #fff;
}
.filter-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgba(0,0,0,.12); padding: 16px; min-width: 300px;
}
.filter-dropdown.open { display: block; }
.filter-section { margin-bottom: 14px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-400); margin-bottom: 6px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-chip {
  padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 400;
  color: var(--gray-500); border: 1px solid var(--gray-200); background: #fff;
  cursor: pointer; transition: all .15s;
}
.filter-chip.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); font-weight: 500; }
.filter-chip:hover:not(.active) { border-color: var(--brand-400); color: var(--brand-600); }
.filter-date-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-date-row input[type=date], .filter-date-row select {
  flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 12.5px; color: var(--gray-700);
  background: #fff; outline: none;
}
.filter-date-row input[type=date]:focus, .filter-date-row select:focus { border-color: var(--brand-400); }
.filter-date-sep { font-size: 12px; color: var(--gray-400); flex-shrink: 0; }
.filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.filter-active-chips { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.filter-active-chip {
  display: flex; align-items: center; gap: 4px; padding: 3px 10px 3px 10px;
  border-radius: 99px; font-size: 12px; font-weight: 500;
  background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-200);
}
.filter-active-chip button { background: none; border: none; cursor: pointer; color: var(--brand-400); font-size: 13px; line-height: 1; padding: 0; display: flex; align-items: center; }
.filter-active-chip button:hover { color: var(--brand-700); }

.mail-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background .1s;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.mail-item:last-child { border-bottom: none; }
.mail-item:hover { background: var(--gray-50); }
.mail-item.unread { background: var(--brand-50); }
.mail-item.unread:hover { background: #dce8f5; }
.mail-item.unread::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-accent); border-radius: 0 3px 3px 0; }

.mail-checkbox { width: 16px; height: 16px; border: 1.5px solid var(--gray-300); border-radius: 4px; flex-shrink: 0; cursor: pointer; appearance: none; transition: all .15s; }
.mail-checkbox:checked { background: var(--brand-500); border-color: var(--brand-500); }
.mail-checkbox:hover { border-color: var(--brand-500); }

.mail-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }

.mail-body { flex: 1; min-width: 0; }
.mail-from { font-size: 13.5px; font-weight: 500; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-item.unread .mail-from { font-weight: 600; color: var(--gray-900); }
.mail-subject { font-size: 13px; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.mail-item.unread .mail-subject { color: var(--gray-700); }
.mail-berkas { font-size: 11px; color: var(--gray-400); font-family: var(--mono); margin-top: 2px; }

.mail-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.mail-date { font-size: 11.5px; color: var(--gray-400); white-space: nowrap; }
.mail-tag { font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.tag-penting { background: var(--amber-100); color: var(--amber-600); }
.tag-urgent { background: var(--red-100); color: var(--red-600); }
.tag-info { background: var(--blue-100); color: var(--blue-600); }
.tag-normal { background: var(--gray-100); color: var(--gray-600); }
.tag-draft { background: var(--gray-100); color: var(--gray-500); border: 1px dashed var(--gray-300); }

/* ── COMPOSE FORM ── */
.compose-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.compose-card { background: #fff; border: 1px solid var(--gray-150); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.compose-card-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.compose-card-title { font-size: 14px; font-weight: 500; color: var(--gray-700); }
.compose-form { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--gray-600); text-transform: uppercase; letter-spacing: .4px; display: flex; align-items: center; gap: 4px; }
.form-label .req { color: var(--red-500); }
.form-control {
  padding: 10px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--gray-900);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  width: 100%;
}
.form-control::placeholder { color: var(--gray-400); }
.form-control:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(26,86,168,.1); }
.form-control.textarea { min-height: 72px; resize: vertical; }

.select-wrap { position: relative; }
.select-wrap::after { content: ''; position: absolute; right: 13px; top: 50%; transform: translateY(-50%); width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--gray-400); pointer-events: none; }
.form-select { appearance: none; padding-right: 34px; cursor: pointer; }

/* Editor toolbar */
.editor-toolbar { display: flex; align-items: center; gap: 2px; padding: 8px 12px; border: 1.5px solid var(--gray-200); border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--gray-50); flex-wrap: wrap; }
.toolbar-btn { padding: 5px 7px; border: none; background: none; border-radius: 4px; cursor: pointer; color: var(--gray-600); font-size: 13px; font-weight: 500; transition: background .1s; line-height: 1; }
.toolbar-btn:hover { background: var(--gray-200); color: var(--gray-900); }
.toolbar-sep { width: 1px; height: 18px; background: var(--gray-200); margin: 0 3px; }
.editor-area { min-height: 200px; border: 1.5px solid var(--gray-200); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 12px 14px; font-size: 14px; color: var(--gray-800); line-height: 1.7; outline: none; }
.editor-area:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(26,86,168,.1); }
.editor-area[contenteditable] { min-height: 200px; }
.editor-area[contenteditable]:empty::before { content: attr(data-placeholder); color: var(--gray-400); }

/* Template row */
.template-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.template-links { display: flex; gap: 12px; }
.tpl-link { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--brand-500); text-decoration: none; font-weight: 500; cursor: pointer; transition: color .1s; }
.tpl-link:hover { color: var(--brand-700); }
.tpl-save { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--gray-500); font-weight: 500; cursor: pointer; transition: color .1s; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 5px 10px; }
.tpl-save:hover { color: var(--gray-700); background: var(--gray-100); }

/* Compose actions */
.compose-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding-top: 4px; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-sm); font-family: var(--font); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: all .15s; border: none; text-decoration: none; }
.btn-primary { background: var(--brand-500); color: #fff; box-shadow: 0 2px 6px rgba(26,86,168,.25); }
.btn-primary:hover { background: var(--brand-400); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(26,86,168,.35); }
.btn-secondary { background: #fff; color: var(--gray-700); border: 1.5px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-ghost { background: none; color: var(--gray-500); border: none; padding: 9px 12px; }
.btn-ghost:hover { color: var(--gray-700); background: var(--gray-100); border-radius: var(--radius-sm); }

/* Sidebar panel (compose) */
.compose-sidebar { display: flex; flex-direction: column; gap: 12px; }
.info-card { background: #fff; border: 1px solid var(--gray-150); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); }
.info-card-title { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); margin-bottom: 12px; }
.info-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--gray-100); }
.info-item:last-child { border-bottom: none; }
.info-key { font-size: 12.5px; color: var(--gray-500); }
.info-val { font-size: 12.5px; color: var(--gray-800); font-weight: 500; font-family: var(--mono); }

/* ── AVATAR COLORS ── */
.av-green { background: var(--brand-50); color: var(--brand-600); }
.av-teal { background: #e0f5f0; color: #0f6e56; }
.av-blue { background: var(--blue-100); color: var(--blue-600); }
.av-amber { background: var(--amber-100); color: var(--amber-600); }
.av-purple { background: #eeebfd; color: #5344b0; }

/* ── MULTI SELECT ── */
.multi-select-wrap { position: relative; }
.multi-select-input {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  min-height: 42px; padding: 6px 12px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.multi-select-input:hover { border-color: var(--gray-300); }
.multi-select-input.open { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(26,86,168,.1); }
.multi-placeholder { font-size: 13.5px; color: var(--gray-400); }
.selected-tags { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.selected-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand-50); color: var(--brand-700);
  border: 1px solid var(--brand-200); border-radius: 20px;
  font-size: 12px; font-weight: 500; padding: 2px 8px;
}
.selected-tag button { background: none; border: none; cursor: pointer; color: var(--brand-400); font-size: 14px; line-height: 1; padding: 0; display: flex; align-items: center; }
.selected-tag button:hover { color: var(--brand-700); }
.multi-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
  background: #fff; border: 1.5px solid var(--gray-200); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; display: none;
}
.multi-dropdown.open { display: block; }
.dropdown-group-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-400); padding: 8px 14px 4px; }
.dropdown-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px; font-size: 13.5px; color: var(--gray-700);
  cursor: pointer; transition: background .1s;
}
.dropdown-opt:hover { background: var(--gray-50); }
.dropdown-opt input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand-500); flex-shrink: 0; cursor: pointer; }

/* ── UPLOAD AREA ── */
.upload-area {
  border: 2px dashed var(--gray-200); border-radius: var(--radius-sm);
  padding: 20px 16px; cursor: pointer; transition: border-color .15s, background .15s;
}
.upload-area:hover { border-color: var(--brand-400); background: var(--brand-50); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .compose-layout { grid-template-columns: 1fr; }
  .compose-sidebar { order: -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .sidebar-overlay.visible { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .search-kbd { display: none; }
  .topbar-search { max-width: none; }
  .page-body { padding: 16px; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .mail-item { padding: 12px 14px; }
  .mail-berkas { display: none; }
  .filter-tabs { overflow-x: auto; }
}

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .mail-meta { display: none; }
  .page-actions .btn span { display: none; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-search { max-width: none; }
}

/* ── ANIMATIONS ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.mail-item { animation: fadeInUp .2s ease both; }
.mail-item:nth-child(1) { animation-delay: .04s; }
.mail-item:nth-child(2) { animation-delay: .08s; }
.mail-item:nth-child(3) { animation-delay: .12s; }
.mail-item:nth-child(4) { animation-delay: .16s; }
.mail-item:nth-child(5) { animation-delay: .20s; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-400); }
.empty-state svg { margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: 14px; }

/* ── USER DROPDOWN MENU ── */
.nav-disabled { opacity: .45; cursor: default; pointer-events: none; }
.user-menu-wrap { position: relative; }
.user-menu-wrap .user-info { cursor: pointer; padding: 6px 8px; border-radius: var(--radius-sm); transition: background .15s; }
.user-menu-wrap .user-info:hover { background: rgba(255,255,255,.07); }
.user-avatar-img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid rgba(255,255,255,.15); }
.user-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--gray-150);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 200;
  animation: fadeInUp .15s ease;
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--gray-700);
  text-decoration: none;
  transition: background .1s;
}
.user-dropdown-item:hover { background: var(--gray-50); color: var(--gray-900); }
.user-dropdown-divider { height: 1px; background: var(--gray-150); margin: 4px 0; }
.user-dropdown-danger { color: var(--red-500); }
.user-dropdown-danger:hover { background: var(--red-50); color: var(--red-600); }

/* ── TOPBAR AVATAR LINK ── */
a.topbar-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--brand-700); border-radius: 50%;
  font-size: 11.5px; font-weight: 600; color: #fff;
  cursor: pointer; text-decoration: none;
  transition: background .15s, transform .15s;
}
a.topbar-avatar:hover { background: var(--brand-600); transform: scale(1.05); }

/* ── FLASH MESSAGES ── */
.flash-msg {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 13.5px; margin-bottom: 16px;
  animation: fadeInUp .2s ease;
}
.flash-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.flash-error { background: var(--red-50); color: var(--red-600); border: 1px solid var(--red-100); }

/* ── FORM HINT ── */
.form-hint { font-size: 11.5px; color: var(--gray-400); margin-top: 3px; }

/* ── PROFILE PAGE ── */
.profile-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.profile-sidebar { display: flex; flex-direction: column; gap: 12px; }
.profile-avatar-card {
  background: #fff; border: 1px solid var(--gray-150);
  border-radius: var(--radius-lg); padding: 24px 20px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.profile-avatar-wrap { position: relative; width: 88px; height: 88px; margin: 0 auto 14px; }
.profile-avatar-initials {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--brand-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; letter-spacing: -1px;
}
.profile-avatar-img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.profile-avatar-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity .2s;
}
.profile-avatar-wrap:hover .profile-avatar-overlay { opacity: 1; }
.profile-name { font-size: 16px; font-weight: 600; color: var(--gray-900); margin-bottom: 2px; }
.profile-org { font-size: 13px; color: var(--gray-500); margin-bottom: 10px; }
.profile-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; letter-spacing: .3px; }
.profile-badge-admin { background: #ede9fe; color: #5b21b6; }
.profile-badge-user { background: var(--brand-50); color: var(--brand-700); }
.profile-meta-list { margin-top: 16px; text-align: left; }
.profile-meta-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--gray-500); padding: 5px 0; }
.profile-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-form-row { grid-template-columns: 1fr; }
}

/* Password field eye button in profile */
.auth-eye-sm {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%); background: none; border: none;
  color: var(--gray-400); cursor: pointer; padding: 4px;
  display: flex; align-items: center;
}
.auth-eye-sm:hover { color: var(--gray-600); }

/* ── ADMIN DASHBOARD ── */
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table thead th {
  text-align: left; padding: 10px 16px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .4px; color: var(--gray-500);
  background: var(--gray-50); border-bottom: 1px solid var(--gray-150);
}
.admin-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--gray-50); }
.admin-user-cell { display: flex; align-items: center; gap: 12px; }
.admin-user-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.admin-user-avatar-img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.admin-user-name { font-size: 13.5px; font-weight: 500; color: var(--gray-800); display: flex; align-items: center; gap: 6px; }
.admin-user-email { font-size: 12px; color: var(--gray-400); }
.admin-org { font-size: 12.5px; color: var(--gray-600); }
.admin-date { font-size: 12px; color: var(--gray-400); white-space: nowrap; }
.admin-you-tag { font-size: 10.5px; background: var(--brand-50); color: var(--brand-600); padding: 1px 7px; border-radius: 20px; font-weight: 500; }
.admin-self-label { color: var(--gray-300); }

.admin-role-select {
  padding: 5px 28px 5px 10px; font-size: 12.5px;
  border: 1.5px solid var(--gray-200); border-radius: 6px;
  appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 4l3 3 3-3' stroke='%239aa3b2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") no-repeat right 8px center;
  cursor: pointer; color: var(--gray-700); transition: border-color .15s;
}
.admin-role-select:focus { outline: none; border-color: var(--brand-500); }

.admin-status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 20px; }
.admin-status-dot { width: 6px; height: 6px; border-radius: 50%; }
.admin-status-active { background: #f0fdf4; color: #15803d; }
.admin-status-active .admin-status-dot { background: #16a34a; }
.admin-status-inactive { background: var(--gray-100); color: var(--gray-500); }
.admin-status-inactive .admin-status-dot { background: var(--gray-400); }

.admin-actions { display: flex; align-items: center; gap: 6px; }
.admin-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s; border: 1.5px solid transparent;
}
.admin-btn-toggle { background: var(--gray-100); color: var(--gray-600); border-color: var(--gray-200); }
.admin-btn-toggle:hover { background: var(--amber-50); color: var(--amber-600); border-color: var(--amber-500); }
.admin-btn-delete { background: var(--red-50); color: var(--red-500); border-color: var(--red-100); }
.admin-btn-delete:hover { background: var(--red-100); border-color: var(--red-500); }

.admin-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 500; max-width: 320px;
  transform: translateY(20px); opacity: 0; transition: all .3s;
  pointer-events: none;
}
.admin-toast-show { transform: translateY(0); opacity: 1; }
.admin-toast-success { background: #15803d; color: #fff; }
.admin-toast-error { background: var(--red-500); color: #fff; }

/* ── AUTH PAGES ── */
.auth-body { background: var(--gray-100); min-height: 100vh; }
.auth-wrap {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-wrap-center {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
}
.auth-panel {
  background: #fff; padding: 40px 44px;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100vh;
}
.auth-panel-sm {
  min-height: auto; max-width: 440px; width: 100%;
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  padding: 36px 40px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.auth-logo { width: 44px; height: 44px; object-fit: contain; }
.auth-brand-name { font-size: 17px; font-weight: 700; color: var(--brand-900); letter-spacing: -.3px; }
.auth-brand-sub { font-size: 11px; color: var(--gray-400); }
.auth-title { font-size: 24px; font-weight: 700; color: var(--gray-900); letter-spacing: -.5px; margin-bottom: 4px; }
.auth-desc { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: 13px; font-weight: 500; color: var(--gray-700); display: flex; justify-content: space-between; align-items: center; }
.auth-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; color: var(--gray-900);
  background: #fff; transition: border-color .15s, box-shadow .15s; outline: none;
}
.auth-input::placeholder { color: var(--gray-400); }
.auth-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(26,86,168,.1); }
.auth-input-group { position: relative; }
.auth-input-group .auth-input { padding-right: 44px; }
.auth-eye {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); background: none; border: none;
  color: var(--gray-400); cursor: pointer; padding: 4px;
  display: flex; align-items: center; transition: color .15s;
}
.auth-eye:hover { color: var(--gray-600); }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 20px;
  background: var(--brand-700); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s; margin-top: 4px;
  box-shadow: 0 2px 8px rgba(7,24,64,.25);
}
.auth-btn:hover { background: var(--brand-600); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(7,24,64,.35); }
.auth-btn:active { transform: translateY(0); }
.auth-alert {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 4px;
}
.auth-alert-error { background: var(--red-50); color: var(--red-600); border: 1px solid var(--red-100); }
.auth-alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.auth-link { color: var(--brand-500); text-decoration: none; font-weight: 500; }
.auth-link:hover { color: var(--brand-700); text-decoration: underline; }
.auth-link-sm { font-size: 12.5px; color: var(--brand-500); text-decoration: none; font-weight: 500; }
.auth-link-sm:hover { text-decoration: underline; }
.auth-footer-text { font-size: 13.5px; color: var(--gray-500); text-align: center; margin-top: 20px; }
.auth-req { color: var(--red-500); }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--gray-500); }
.auth-back-link:hover { color: var(--gray-700); }
.auth-icon-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-icon-circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand-50); color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--brand-100);
}

/* Password strength bar */
.password-strength { height: 3px; background: var(--gray-200); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.strength-fill { height: 100%; width: 0; transition: width .3s, background .3s; border-radius: 99px; }
.strength-label { font-size: 11.5px; font-weight: 500; margin-top: 2px; }

/* Auth decoration panel */
.auth-deco {
  background: linear-gradient(145deg, var(--brand-900) 0%, var(--brand-700) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 48px; position: relative; overflow: hidden;
}
.auth-deco::before {
  content: ''; position: absolute;
  width: 600px; height: 600px; border-radius: 50%;
  background: rgba(255,255,255,.03);
  top: -200px; right: -200px;
}
.auth-deco::after {
  content: ''; position: absolute;
  width: 400px; height: 400px; border-radius: 50%;
  background: rgba(255,255,255,.04);
  bottom: -150px; left: -100px;
}
.auth-deco-content { position: relative; z-index: 1; max-width: 380px; }
.auth-deco-logo { width: 56px; height: 56px; object-fit: contain; margin-bottom: 20px; }
.auth-deco-title { font-size: 30px; font-weight: 700; color: #fff; letter-spacing: -.8px; margin-bottom: 12px; line-height: 1.2; }
.auth-deco-sub { font-size: 15px; color: rgba(255,255,255,.6); line-height: 1.7; margin-bottom: 32px; }
.auth-deco-features { display: flex; flex-direction: column; gap: 12px; }
.auth-deco-feat { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255,255,255,.8); }
.auth-deco-feat svg { color: var(--brand-accent); flex-shrink: 0; }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-deco { display: none; }
  .auth-panel { min-height: auto; padding: 32px 24px; }
  .auth-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .auth-panel { padding: 24px 16px; }
  .auth-panel-sm { border-radius: var(--radius-lg); padding: 28px 20px; }
}

/* ── ADMIN TABS ── */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--gray-150); padding-bottom: 0; }
.admin-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 18px; font-size: 13.5px; font-weight: 500;
  color: var(--gray-500); background: none; border: none;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .15s;
}
.admin-tab:hover { color: var(--brand-600); }
.admin-tab.active { color: var(--brand-700); border-bottom-color: var(--brand-700); }
.admin-tab-panel { animation: fadeInUp .2s ease; }

/* ── ROLE HIERARCHY CARD ── */
.role-hierarchy-card {
  background: #fff; border: 1px solid var(--gray-150);
  border-radius: var(--radius-lg); padding: 20px 24px;
  margin-top: 16px; box-shadow: var(--shadow-sm);
}
.role-hierarchy-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); margin-bottom: 16px; }
.role-hierarchy-items { display: flex; flex-direction: column; gap: 0; }
.role-hi-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--radius-md); }
.role-hi-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-hi-name { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.role-hi-desc { font-size: 12.5px; color: var(--gray-500); }
.role-hi-admin { background: #faf5ff; }
.role-hi-admin .role-hi-icon { background: #ede9fe; color: #5b21b6; }
.role-hi-admin .role-hi-name { color: #5b21b6; }
.role-hi-direktur { background: #fffbeb; }
.role-hi-direktur .role-hi-icon { background: var(--amber-100); color: var(--amber-600); }
.role-hi-direktur .role-hi-name { color: var(--amber-600); }
.role-hi-user { background: var(--brand-50); }
.role-hi-user .role-hi-icon { background: var(--brand-100); color: var(--brand-600); }
.role-hi-user .role-hi-name { color: var(--brand-700); }
.role-hi-separator { height: 1px; background: var(--gray-100); margin: 0 16px; }

/* Role badges extended */
.profile-badge-direktur { background: var(--amber-100); color: var(--amber-600); }

/* ── LOG TABLE ── */
.log-action-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.log-action-login, .log-action-register { background: #f0fdf4; color: #15803d; }
.log-action-logout { background: var(--gray-100); color: var(--gray-600); }
.log-action-login_failed { background: var(--red-50); color: var(--red-600); }
.log-action-email_sent { background: var(--brand-50); color: var(--brand-700); }
.log-action-email_draft { background: var(--gray-100); color: var(--gray-600); }
.log-action-email_read { background: #eff6ff; color: #1d4ed8; }
.log-action-password_change, .log-action-password_reset, .log-action-password_reset_request { background: var(--amber-50); color: var(--amber-600); }
.log-action-profile_update, .log-action-avatar_update { background: #faf5ff; color: #5b21b6; }
.log-action-user_role_changed, .log-action-user_toggled, .log-action-user_deleted { background: #fff7ed; color: #c2410c; }
.log-action-system { background: var(--gray-100); color: var(--gray-500); }

.log-cat-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.log-cat-auth { background: var(--brand-50); color: var(--brand-700); }
.log-cat-email { background: #f0fdf4; color: #15803d; }
.log-cat-user_management { background: #fff7ed; color: #c2410c; }
.log-cat-profile { background: #faf5ff; color: #5b21b6; }
.log-cat-system { background: var(--gray-100); color: var(--gray-500); }

.log-status-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 500; }
.log-status-success { background: #f0fdf4; color: #15803d; }
.log-status-failed { background: var(--red-50); color: var(--red-600); }
.log-status-warning { background: var(--amber-50); color: var(--amber-600); }

/* ── BRAND LOGO (no bg) ── */
.brand-logo { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }

/* favicon link */

/* ── FEATURE LAYOUT (shared) ── */
.feature-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; margin-bottom: 0; }
@media (max-width: 900px) { .feature-layout { grid-template-columns: 1fr; } }

/* ── SHORT URL PAGE ── */
.url-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-100);
  gap: 16px; flex-wrap: wrap;
}
.url-item:last-child { border-bottom: none; }
.url-item:hover { background: var(--gray-50); }
.url-item-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.url-item-code { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.url-short-code { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--brand-700); background: var(--brand-50); padding: 4px 10px; border-radius: 6px; }
.url-copy-btn { background: none; border: none; color: var(--gray-400); cursor: pointer; padding: 4px; border-radius: 4px; transition: all .15s; display: flex; align-items: center; }
.url-copy-btn:hover { background: var(--brand-50); color: var(--brand-600); }
.url-original { min-width: 0; }
.url-link { font-size: 13.5px; font-weight: 500; color: var(--gray-800); text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.url-link:hover { color: var(--brand-600); text-decoration: underline; }
.url-original-text { font-size: 11.5px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.url-item-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.url-clicks { font-size: 12px; color: var(--gray-500); display: flex; align-items: center; gap: 4px; }

/* ── TUGAS PAGE ── */
.task-item {
  display: flex; align-items: flex-start;
  gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--gray-50); }
.task-item-left { flex-shrink: 0; padding-top: 2px; }
.task-check-btn { background: none; border: none; cursor: pointer; padding: 0; display: flex; transition: transform .15s; }
.task-check-btn:hover { transform: scale(1.1); }
.task-item-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 500; color: var(--gray-800); margin-bottom: 3px; }
.task-done-text { text-decoration: line-through; color: var(--gray-400); }
.task-desc { font-size: 13px; color: var(--gray-500); margin-bottom: 6px; }
.task-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-status-label { font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 20px; }
.task-status-pending { background: var(--gray-100); color: var(--gray-500); }
.task-status-progress { background: var(--amber-100); color: var(--amber-600); }
.task-status-done { background: #dcfce7; color: #15803d; }
.task-status-cancel { background: var(--red-50); color: var(--red-500); }
.task-from-badge, .task-assign-badge { font-size: 11.5px; color: var(--gray-400); font-style: italic; }
.task-due { font-size: 11.5px; color: var(--gray-400); display: flex; align-items: center; gap: 3px; }
.task-due-late { color: var(--red-500); font-weight: 500; }
.task-item-actions { flex-shrink: 0; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 1000; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(3px); padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: #fff; border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  animation: fadeInUp .2s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.modal-close { background: none; border: none; font-size: 22px; color: var(--gray-400); cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 6px; transition: all .15s; }
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-card .compose-form { padding: 16px 24px 24px; }

/* ── DIGSIG PAGE ── */
.sig-preview-box { background: var(--gray-50); border: 1.5px solid var(--gray-200); border-radius: var(--radius-md); padding: 16px; display: flex; align-items: center; justify-content: center; min-height: 100px; margin-bottom: 12px; }
.sig-preview-img { max-height: 100px; max-width: 100%; object-fit: contain; }
.sig-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.sig-info-item { display: flex; flex-direction: column; gap: 1px; }
.sig-info-key { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-400); font-weight: 600; }
.sig-info-val { font-size: 13px; color: var(--gray-800); font-weight: 500; }

/* ── DIGSIG LAYOUT ── */
.digsig-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .digsig-layout { grid-template-columns: 1fr; } }

.sig-canvas-wrap { position: relative; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.sig-canvas-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--gray-300); pointer-events: none; user-select: none; }
.sig-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .sig-fields-grid { grid-template-columns: 1fr; } }

/* QR Card */
.qr-card {
  background: #fff; border: 1px solid var(--gray-150);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.qr-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500);
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.qr-code-wrap { display: flex; justify-content: center; padding: 20px 16px 12px; }
.qr-code-img { width: 180px; height: 180px; border: 4px solid var(--brand-900); border-radius: 12px; }
.qr-sig-preview { display: flex; justify-content: center; padding: 0 16px 8px; min-height: 48px; }
.qr-sig-img { max-height: 48px; max-width: 100%; object-fit: contain; }
.qr-info { text-align: center; padding: 0 16px 16px; }
.qr-info-name { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.qr-info-pos { font-size: 12.5px; color: var(--gray-500); margin-top: 2px; }
.qr-info-org { font-size: 12px; color: var(--gray-400); }
.qr-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.qr-verify-link {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--brand-500);
  text-decoration: none; transition: color .15s;
}
.qr-verify-link:hover { color: var(--brand-700); text-decoration: underline; }

/* Digsig steps */
.digsig-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.digsig-step { display: flex; align-items: flex-start; gap: 10px; }
.digsig-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-700); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.digsig-step-text { font-size: 12.5px; color: var(--gray-600); line-height: 1.5; }

/* ── DIGSIG v2 ── */
.digsig-warning {
  display: flex; align-items: flex-start; gap: 8px;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; color: #92400e; line-height: 1.5;
}
.digsig-warning svg { flex-shrink: 0; margin-top: 1px; }

.btn-generate { gap: 9px; padding: 11px 24px; font-size: 14px; }

.qr-live-badge {
  margin-left: auto; background: #16a34a; color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; letter-spacing: .6px;
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0%,100% { opacity: 1; } 50% { opacity: .5; }
}

.qr-timestamp, .qr-location {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--gray-400);
  font-family: var(--mono); margin-top: 4px;
  justify-content: center;
}

.qr-empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px; gap: 14px;
}
.qr-empty-icon { color: var(--gray-300); }
.qr-empty-text { font-size: 13px; color: var(--gray-400); text-align: center; line-height: 1.6; }
.qr-empty-text strong { color: var(--brand-600); }

/* Loading overlay */
.qr-loading-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(7,24,64,.55); z-index: 2000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.qr-loading-box {
  background: #fff; border-radius: var(--radius-xl);
  padding: 36px 48px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.qr-spinner {
  width: 44px; height: 44px; border: 4px solid var(--brand-100);
  border-top-color: var(--brand-700); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.qr-loading-text { font-size: 14px; font-weight: 500; color: var(--gray-700); }

/* ── AGREEMENT / PENOMORAN ── */
.ag-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-100);
  text-decoration: none; color: inherit; transition: background .1s;
}
.ag-item:last-child { border-bottom: none; }
.ag-item:hover { background: var(--gray-50); }

.ag-type-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 6px; letter-spacing: .5px; flex-shrink: 0; text-align: center; min-width: 56px;
}
.ag-mou     { background: #ede9fe; color: #5b21b6; }
.ag-pks     { background: var(--brand-50); color: var(--brand-700); }
.ag-spk     { background: var(--amber-100); color: var(--amber-600); }
.ag-kontrak { background: var(--red-50); color: var(--red-600); }

.ag-body { flex: 1; min-width: 0; }
.ag-nomor { font-size: 12px; font-family: var(--mono); color: var(--gray-400); margin-bottom: 2px; }
.ag-judul { font-size: 13.5px; font-weight: 500; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-meta  { display: flex; align-items: center; gap: 12px; margin-top: 3px; flex-wrap: wrap; }
.ag-pihak, .ag-nilai, .ag-tanggal { font-size: 12px; color: var(--gray-500); display: flex; align-items: center; gap: 4px; }
.ag-nilai { color: var(--green-600); font-weight: 500; }
.ag-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }

/* Type selector grid */
.ag-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 700px) { .ag-type-grid { grid-template-columns: repeat(2,1fr); } }
.ag-type-option input { display: none; }
.ag-type-card {
  border: 2px solid var(--gray-200); border-radius: var(--radius-md);
  padding: 12px 10px; text-align: center; cursor: pointer;
  transition: all .15s; user-select: none;
}
.ag-type-option input:checked + .ag-type-card { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(26,86,168,.1); }
.ag-type-card:hover { border-color: var(--gray-300); }
.ag-type-key { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.ag-type-sub { font-size: 10.5px; color: var(--gray-400); line-height: 1.3; }
.ag-mou-card .ag-type-key   { color: #5b21b6; }
.ag-pks-card .ag-type-key   { color: var(--brand-700); }
.ag-spk-card .ag-type-key   { color: var(--amber-600); }
.ag-kontrak-card .ag-type-key { color: var(--red-600); }

.ag-nomor-preview {
  font-family: var(--mono); font-size: 13px;
  background: var(--gray-100); color: var(--gray-400);
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--gray-300);
}
.ag-nomor-preview-active {
  background: var(--brand-50); color: var(--brand-700);
  border-color: var(--brand-300); font-weight: 600;
}

/* Detail layout */
.ag-detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .ag-detail-layout { grid-template-columns: 1fr; } }
.ag-detail-grid { display: flex; flex-direction: column; gap: 0; }
.ag-detail-row { display: flex; padding: 9px 0; border-bottom: 1px solid var(--gray-100); gap: 16px; align-items: baseline; }
.ag-detail-row:last-child { border-bottom: none; }
.ag-detail-key { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--gray-400); min-width: 140px; flex-shrink: 0; }
.ag-detail-val { font-size: 13.5px; color: var(--gray-800); flex: 1; }
.ag-nomor-big { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--brand-700); }

/* Timeline */
.ag-timeline { display: flex; flex-direction: column; gap: 0; }
.ag-timeline-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.ag-timeline-item::before { content: ''; position: absolute; left: 7px; top: 20px; bottom: 0; width: 2px; background: var(--gray-150); }
.ag-timeline-item:last-child::before { display: none; }
.ag-timeline-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--gray-200); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--gray-200); flex-shrink: 0; margin-top: 3px; }
.ag-timeline-latest .ag-timeline-dot { background: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-200); }
.ag-timeline-content { flex: 1; }
.ag-timeline-status { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }

/* ── SURAT MASUK ── */
.sm-status-badge { display:inline-block; padding:2px 10px; border-radius:20px; font-size:12px; font-weight:500; }
.sm-baru    { background:#fef3f2; color:var(--red-500); }
.sm-dibaca  { background:var(--gray-100); color:var(--gray-600); }
.sm-tindak  { background:var(--amber-100); color:var(--amber-600); }
.sm-selesai { background:#f0fdf4; color:#15803d; }

.sm-upload-area {
  border:2px dashed var(--gray-200); border-radius:var(--radius-sm);
  padding:20px 16px; cursor:pointer; transition:border-color .15s, background .15s; text-align:center;
}
.sm-upload-area:hover { border-color:var(--brand-400); background:var(--brand-50); }

.sm-file-row { display:flex; align-items:center; gap:14px; padding:10px 0; }
.sm-file-icon { width:40px; height:40px; border-radius:8px; background:var(--gray-100); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.sm-file-info { flex:1; min-width:0; }
.sm-file-name { font-size:13.5px; font-weight:500; color:var(--gray-800); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sm-file-size { font-size:12px; color:var(--gray-400); }

.modal-card-lg { max-width:720px; }
