/* ── Brand theme overrides for ktui ──────────────────────────── */
:root {
  --primary:            oklch(42% 0.15 248);   /* #185fa5 */
  --primary-foreground: oklch(1 0 0);
  --radius:             0.5rem;
  --font-sans:          -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-size: 13px;
  color: #1a1a18;
  background: #f4f3ef;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
#sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #e0dfd8;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 20;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid #e0dfd8;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-logo-name { font-size: 13px; font-weight: 600; color: #1a1a18; }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px 10px 10px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-heading {
  font-size: 10px;
  font-weight: 600;
  color: #9b9a93;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px 10px 4px;
}
.sidebar-heading:first-child { padding-top: 4px; }

.sidebar-item { position: relative; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #4a4942;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.sidebar-link:hover { background: #f0eeea; color: #1a1a18; }

.sidebar-icon {
  color: #9b9a93;
  width: 18px;
  font-size: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.sidebar-item.active .sidebar-link { background: #e6f1fb; color: #185fa5; }
.sidebar-item.active .sidebar-icon { color: #185fa5; }
.sidebar-item.active .sidebar-link:hover { background: #d9eaf8; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #e0dfd8;
  flex-shrink: 0;
}
.sidebar-footer-name { font-size: 12px; font-weight: 600; color: #1a1a18; }

/* ── Main wrapper ─────────────────────────────────────────────── */
#main-wrapper { margin-left: 220px; flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Logo dot ────────────────────────────────────────────────── */
.logo-dot { width: 9px; height: 9px; border-radius: 50%; background: #185fa5; flex-shrink: 0; }

/* ── User avatar ─────────────────────────────────────────────── */
.avatar-sm { width: 26px; height: 26px; border-radius: 50%; background: #e6f1fb; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #185fa5; }

/* ── Main content ─────────────────────────────────────────────── */
.wf-content { flex: 1; overflow-y: auto; padding: 22px; background: #f4f3ef; height: 100vh; }

/* ── Screens ─────────────────────────────────────────────────── */
.screen        { display: none; }
.screen.active { display: block; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.page-title  { font-size: 17px; font-weight: 600; color: #1a1a18; }
.page-sub    { font-size: 12px; color: #6b6a64; margin-top: 2px; }

/* ── Button group ─────────────────────────────────────────────── */
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Cards ───────────────────────────────────────────────────── */
.card       { background: #fff; border: 1px solid #e0dfd8; border-radius: 10px; padding: 16px; margin-bottom: 13px; }
.card-title { font-size: 13px; font-weight: 600; color: #1a1a18; margin-bottom: 13px; }

/* ── Stats ───────────────────────────────────────────────────── */
.stats-row  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card  { background: #f4f3ef; border-radius: 8px; padding: 13px; }
.stat-label { font-size: 11px; color: #6b6a64; margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 600; }
.stat-value.blue  { color: #185fa5; }
.stat-value.green { color: #3b6d11; }
.stat-value.amber { color: #854f0b; }
.stat-value.red   { color: #a32d2d; }

/* ── Search bar ──────────────────────────────────────────────── */
.search-bar       { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.search-bar input { flex: 1; padding: 7px 11px; font-size: 12px; border: 1px solid #c8c7c0; border-radius: 7px; background: #fff; color: #1a1a18; }
.filter-select    { padding: 7px 10px; font-size: 12px; border: 1px solid #c8c7c0; border-radius: 7px; background: #fff; color: #6b6a64; min-width: 130px; }

/* ── Tables ──────────────────────────────────────────────────── */
.data-table     { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th  { text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 600; color: #6b6a64; border-bottom: 1px solid #e0dfd8; background: #fafaf8; }
.data-table td  { padding: 9px 10px; border-bottom: 1px solid #e0dfd8; color: #1a1a18; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td      { background: #fafaf8; }
.data-table .link            { color: #185fa5; cursor: pointer; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-grid     { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-full     { grid-column: 1 / -1; }
.form-group    { display: flex; flex-direction: column; gap: 4px; }
.form-label    { font-size: 11px; font-weight: 600; color: #6b6a64; }
.form-label .req { color: #a32d2d; }
.form-input, .form-select, .form-textarea { padding: 7px 10px; font-size: 12px; border: 1px solid #c8c7c0; border-radius: 7px; background: #fff; color: #1a1a18; width: 100%; font-family: inherit; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: 2px solid #b5d4f4; outline-offset: 1px; border-color: #378add; }
.form-input.autofill { background: #f4f3ef; color: #6b6a64; }
.form-textarea { min-height: 66px; resize: vertical; }
.upload-box    { border: 1px dashed #c8c7c0; border-radius: 7px; padding: 13px; text-align: center; font-size: 11px; color: #6b6a64; background: #fafaf8; cursor: pointer; }
.upload-box span { color: #185fa5; }

/* ── Dividers & section headings ─────────────────────────────── */
hr.divider       { border: none; border-top: 1px solid #e0dfd8; margin: 14px 0; }
.section-heading { font-size: 11px; font-weight: 600; color: #6b6a64; margin-bottom: 9px; text-transform: uppercase; letter-spacing: .05em; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline          { border-left: 1px solid #d3d1c7; padding-left: 16px; }
.timeline-item     { position: relative; margin-bottom: 13px; }
.timeline-dot      { position: absolute; left: -21px; top: 3px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid #c8c7c0; background: #fff; }
.timeline-dot.done    { background: #639922; border-color: #639922; }
.timeline-dot.current { background: #378add; border-color: #378add; }
.timeline-label    { font-size: 12px; font-weight: 600; color: #1a1a18; }
.timeline-meta     { font-size: 11px; color: #6b6a64; margin-top: 1px; }

/* ── Content tabs ────────────────────────────────────────────── */
.tabs     { display: flex; border-bottom: 1px solid #e0dfd8; margin-bottom: 13px; }
.tab      { padding: 8px 14px; font-size: 12px; color: #6b6a64; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover  { color: #1a1a18; }
.tab.active { color: #185fa5; font-weight: 600; border-bottom-color: #185fa5; }

/* ── Layout helpers ──────────────────────────────────────────── */
.two-col    { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.action-row { display: flex; gap: 5px; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.pag-info   { font-size: 11px; color: #6b6a64; }

/* ── Email trigger inline badge ──────────────────────────────── */
.email-trigger { font-size: 10px; color: #185fa5; background: #e6f1fb; border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }

/* ── Export button ───────────────────────────────────────────── */
.export-btn       { position: fixed; bottom: 20px; right: 20px; background: #185fa5; color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 12px rgba(24,95,165,.3); z-index: 999; }
.export-btn:hover { background: #0c447c; }
