/* =========================================================================
   HESCOM Support Portal — cream + green theme
   Locked palette: warm off-white surfaces, green primary, rose/amber/blue semantic.
   ========================================================================= */

:root {
  --bg:            #eeebe2;   /* canvas / page ground */
  --bg-panel:      #f8f6f0;   /* sidebar / panel */
  --bg-card:       #fdfcf7;   /* cards */
  --bg-card-2:     #f0eee5;   /* subtle fills, inputs */
  --bg-hover:      #eeebe1;
  --border:        #e6e2d5;
  --border-soft:   #efece3;
  --text:          #20211a;
  --text-dim:      #6c685b;
  --text-mute:     #a5a08f;
  --accent:        #1f8a54;   /* green (primary) */
  --accent-2:      #33a869;   /* green mid */
  --accent-3:      #15683f;   /* green dark */
  --green:         #1f8a54;
  --red:           #cd5464;   /* rose */
  --amber:         #bd8127;
  --grad:          linear-gradient(135deg, #2e9e63 0%, #1f8a54 60%, #15683f 100%);
  --grad-soft:     linear-gradient(135deg, rgba(31,138,84,.13), rgba(51,168,105,.06));
  --radius:        18px;
  --radius-sm:     12px;
  --sidebar-w:     236px;
  --shadow:        0 6px 22px rgba(80,66,38,.09);
  --font:          'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #ddd6c6; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #cfc7b4; }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: #ddd6c6 transparent; }

/* ---------- App shell (floating panel) ---------- */
.app {
  display: flex;
  max-width: 1440px;
  height: calc(100vh - 28px);
  margin: 14px auto;
  background: var(--bg-panel);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(80,66,38,.15);
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-soft);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 22px;
}
.brand .logo-img {
  width: 38px; height: 38px; border-radius: 10px; object-fit: contain;
  background: #fff; padding: 3px; border: 1px solid var(--border);
}
.brand .brand-name { font-weight: 700; font-size: 16px; letter-spacing: .2px; line-height: 1.1; }
.brand .brand-sub { font-size: 11px; color: var(--text-mute); }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
  color: var(--text-mute); padding: 14px 12px 6px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--text-dim); font-weight: 500; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-card-2); color: var(--text); }
.nav-item.active { background: var(--grad-soft); color: var(--accent-3); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px;
  width: 3.5px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.nav-item.active svg { color: var(--accent); }
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: var(--accent); color: #fff; border-radius: 20px; padding: 1px 8px;
}

/* sidebar promo */
.side-promo { margin-top: 12px; flex-shrink: 0; border-radius: var(--radius-sm); padding: 15px 14px; color: #eafff2; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 80% 10%, #1f8a54 0%, #124e31 60%, #0c3a24 100%); }
.side-promo .pi { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.16); display: grid; place-items: center; margin-bottom: 18px; }
.side-promo .pi svg { width: 16px; height: 16px; }
.side-promo b { font-size: 13.5px; font-weight: 700; display: block; }
.side-promo span { font-size: 11.5px; opacity: .82; display: block; margin-top: 3px; }
.side-promo .promo-btn { display: block; text-align: center; background: #eafff2; color: #124e31; font-weight: 700; font-size: 12.5px; padding: 8px; border-radius: 9px; text-decoration: none; margin-top: 12px; position: relative; z-index: 1; }
.side-promo .promo-btn:hover { filter: brightness(.97); }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 26px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0; background: var(--bg-panel); z-index: 20;
}
.menu-btn { display: none; }
.search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px;
}
.search input { background: none; border: none; outline: none; color: var(--text); width: 100%; font-size: 13.5px; font-family: inherit; }
.search svg { width: 16px; height: 16px; color: var(--text-mute); }

/* ---------- Global Search Popover ---------- */
.search-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(0,0,0,.15);
  max-height: 480px;
  overflow-y: auto;
  z-index: 1000;
  padding: 8px;
}
.search-pop-sec {
  margin-bottom: 8px;
}
.search-pop-head {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-mute);
  padding: 6px 10px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-pop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: background .12s;
}
.search-pop-item:hover, .search-pop-item.active {
  background: var(--bg-card-2);
}
.search-pop-item .sp-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-pop-item .sp-sub {
  font-size: 11.5px;
  color: var(--text-dim);
}
.search-pop-foot {
  padding: 8px 10px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
}
.search-pop-foot a {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-3);
  text-decoration: none;
}
.search-pop-empty {
  padding: 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-mute);
}
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-card-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text-dim);
  cursor: pointer; transition: background .15s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .ndot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; border: 2px solid var(--bg-card-2); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 15px; }
.profile { display: flex; align-items: center; gap: 10px; padding-left: 4px; text-decoration: none; }
.profile .p-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; display: block; }
.profile .p-mail { font-size: 11.5px; color: var(--text-mute); }

.content { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 26px 40px; }
.page-head { margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin: 0; }
.page-head p { color: var(--text-dim); font-size: 13.5px; margin-top: 4px; }
.page-head-action { flex-shrink: 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { color: var(--text-dim); font-size: 12.5px; }

/* ---------- Stat grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.stat::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--grad-soft); filter: blur(6px);
}
.stat .stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: var(--grad-soft); border: 1px solid rgba(31,138,84,.20);
  color: var(--accent);
}
.stat .stat-icon svg { width: 20px; height: 20px; }
.stat .stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat .stat-label { color: var(--text-dim); font-size: 13px; margin-top: 8px; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  border: 1px solid transparent;
}
.badge.green  { color: #1f8a54; background: rgba(31,138,84,.12);  border-color: rgba(31,138,84,.28); }
.badge.red    { color: #cd5464; background: rgba(205,84,100,.12); border-color: rgba(205,84,100,.30); }
.badge.amber  { color: #bd8127; background: rgba(189,129,39,.13); border-color: rgba(189,129,39,.30); }
.badge.blue   { color: #3b7fd6; background: rgba(59,127,214,.12); border-color: rgba(59,127,214,.28); }
.badge.gray   { color: var(--text-dim); background: var(--bg-card-2); border-color: var(--border); }
.badge.violet { color: #7a5ad6; background: rgba(122,90,214,.12); border-color: rgba(122,90,214,.28); }

/* status dots */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green); } .dot.red { background: var(--red); }
.dot.amber { background: var(--amber); } .dot.gray { background: var(--text-mute); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-mute); font-weight: 600; padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
table.data tbody tr:hover { background: var(--bg-card-2); }
table.data tbody tr:last-child td { border-bottom: none; }

/* ---------- Forms ---------- */
label.field-label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 7px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px; color: var(--text);
  font-size: 14px; font-family: var(--font); outline: none; transition: border .15s;
}
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--grad-soft); }
/* native select: custom chevron + no OS arrow, consistent cream look */
select.input {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a5a08f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.form-row { margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 18px; border-radius: 24px; font-weight: 600; font-size: 13.5px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  cursor: pointer; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 4px 16px rgba(31,138,84,.3); }
.btn-primary:hover { filter: brightness(1.08); background: var(--grad); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }

/* Icon action buttons with tooltips (users, templates, …) */
.u-act { display: inline-flex; align-items: center; gap: 3px; justify-content: flex-end; }
.ib { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: none; background: none; color: var(--text-mute); cursor: pointer; padding: 0; }
.ib svg { width: 16px; height: 16px; }
.ib:hover { background: var(--bg-card); color: var(--accent); }
.ib.danger:hover { color: var(--red); }
.ib[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%); background: var(--text); color: #fdfcf7; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; z-index: 6; pointer-events: none; }
.ib[data-tip]:hover::before { content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--text); z-index: 6; }

/* ---------- Flash (Option 4: Elevated Card with Badge Icon) ---------- */
.flash { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; margin-bottom: 18px; font-size: 13.5px; line-height: 1.45; background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07); transition: opacity .3s ease, transform .3s ease; }
.flash-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.flash.error { border-color: #fca5a5; color: #991b1b; }
.flash.error .flash-icon { background: #fee2e2; color: #dc2626; }
.flash.success { border-color: #86efac; color: #166534; }
.flash.success .flash-icon { background: #dcfce7; color: #16a34a; }
.flash.info { border-color: #93c5fd; color: #1e40af; }
.flash.info .flash-icon { background: #dbeafe; color: #2563eb; }
.flash-msg { flex: 1; font-weight: 500; }
.flash-close { background: var(--bg-card-2); border: 1px solid var(--border); width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim); cursor: pointer; flex-shrink: 0; transition: all 0.15s ease; }
.flash-close:hover { background: var(--text); color: #ffffff; border-color: var(--text); transform: scale(1.06); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 70% -10%, rgba(31,138,84,.12), transparent),
              radial-gradient(900px 500px at 10% 110%, rgba(51,168,105,.08), transparent), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 22px; padding: 38px 34px; box-shadow: 0 12px 40px rgba(80,66,38,.12); }
.login-card .brand { justify-content: center; padding-bottom: 10px; }

/* ---------- Utility ---------- */
.flex { display: flex; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-0 { margin-bottom: 0; }
.text-dim { color: var(--text-dim); } .text-mute { color: var(--text-mute); }
.text-right { text-align: right; } .w-full { width: 100%; }
.muted-mono { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-mute); }
.pill-select { position: relative; }

/* ---------- Direction-C list pages (shared) ---------- */
.cx-strip { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cx-m { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 14px; padding: 12px 18px; box-shadow: var(--shadow); min-width: 118px; }
.cx-m .n { font-size: 24px; font-weight: 800; letter-spacing: -.6px; line-height: 1; font-variant-numeric: tabular-nums; }
.cx-m .l { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; }
.cx-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cx-seg { display: inline-flex; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; max-width: 100%; overflow-x: auto; }
.cx-seg a { background: none; font-size: 12.5px; font-weight: 600; color: var(--text-dim); padding: 7px 13px; border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.cx-seg a.on { background: var(--bg-card); color: var(--accent-3); box-shadow: var(--shadow); }
.cx-seg a:hover:not(.on) { color: var(--text); }
.cx-search { display: flex; align-items: center; gap: 9px; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: 11px; padding: 9px 13px; min-width: 210px; margin: 0; }
.cx-search svg { width: 16px; height: 16px; color: var(--text-mute); }
.cx-search input { border: none; background: none; outline: none; color: var(--text); font-size: 13px; font-family: inherit; width: 100%; }
.cx-tbl { width: 100%; border-collapse: separate; border-spacing: 0 7px; }
.cx-tbl th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-mute); font-weight: 600; padding: 0 12px 4px; }
.cx-tbl td { background: var(--bg-card-2); padding: 12px; font-size: 13px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); vertical-align: middle; }
.cx-tbl td:first-child { border-left: 3px solid var(--border); border-radius: 11px 0 0 11px; }
.cx-tbl td:last-child { border-right: 1px solid var(--border); border-radius: 0 11px 11px 0; }
.cx-tbl tr:hover td { background: var(--bg-card); }
.cx-tk { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-dim); }
.cx-open { color: var(--green); font-weight: 600; font-size: 12.5px; text-decoration: none; }
@media (max-width: 1000px) { .cx-strip .cx-m { flex: 1; } }

/* ---------- Shared detail-card components (dashboard + profile + user-view) ---------- */
.d-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.d-ch { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.d-ch h3 { font-size: 14px; font-weight: 700; margin: 0; }
.d-ch .lk { font-size: 12px; color: var(--text-dim); font-weight: 600; text-decoration: none; }
.d-ch .lk:hover { color: var(--accent); }
.d-li { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.d-li:last-child { border-bottom: none; }
.d-li .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.d-li .ic svg { width: 16px; height: 16px; }
.d-li b { font-size: 12.5px; font-weight: 600; display: block; }
.d-li small { font-size: 11px; color: var(--text-mute); }
.d-li .mt { margin-left: auto; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Custom themed dropdown (JS-enhanced native <select>) ---------- */
.csel { position: relative; display: block; width: 100%; }
.csel.auto { display: inline-block; width: auto; vertical-align: middle; }
.csel-native { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.csel-btn { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; color: var(--text); font-size: 14px; font-family: var(--font); line-height: 1.2; cursor: pointer; text-align: left; transition: border .15s, box-shadow .15s; }
.csel.auto .csel-btn { width: auto; padding: 9px 12px; font-size: 13px; }
.csel-btn:hover { border-color: #d8d2c2; }
.csel-btn .cv { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csel-btn .cv.ph { color: var(--text-mute); }
.cs-chev { width: 16px; height: 16px; color: var(--text-mute); flex-shrink: 0; transition: transform .15s; }
.csel.open .csel-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--grad-soft); }
.csel.open .cs-chev { transform: rotate(180deg); }
.csel-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.csel-panel { position: absolute; left: 0; top: calc(100% + 5px); z-index: 90; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 34px rgba(80,66,38,.16); padding: 5px; max-height: 264px; overflow-y: auto; scroll-padding: 6px 0; animation: cselIn .12s ease; min-width: 100%; width: max-content; max-width: 360px; box-sizing: border-box; }
.csel-panel.up { top: auto; bottom: calc(100% + 5px); }
.csel.auto .csel-panel { right: auto; min-width: 100%; width: max-content; max-width: 360px; }
@keyframes cselIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.csel-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; }
.csel-opt:hover, .csel-opt.hi { background: var(--bg-hover); }
.csel-opt.sel { background: var(--grad-soft); color: var(--accent-3); font-weight: 600; }
.csel-opt > span { flex: 1 1 auto; white-space: nowrap; }
.csel-opt .ck { width: 15px; height: 15px; flex-shrink: 0; opacity: 0; margin-left: 6px; }
.csel-opt.sel .ck { opacity: 1; }
.csel-opt.dis { opacity: .45; cursor: not-allowed; }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 900px) {
  .app { margin: 0; height: 100vh; max-width: none; border-radius: 0; }
  .sidebar { position: fixed; left: -260px; top: 0; height: 100vh; z-index: 60; transition: left .2s; box-shadow: 0 20px 50px rgba(80,66,38,.25); }
  .sidebar.open { left: 0; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .search { max-width: none; }
  .menu-btn { display: grid; }
  .profile .p-name, .profile .p-mail { display: none; }
}

/* ---------- Custom Theme-Based DateTime Picker ---------- */
.hdtp-wrap { position: relative; width: 100%; display: block; }
.hdtp-wrap .input { width: 100%; padding-right: 36px !important; background: var(--bg-card-2); cursor: pointer; font-size: 13px; font-weight: 500; }
.hdtp-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-mute); pointer-events: none; display: flex; align-items: center; justify-content: center; }
.hdtp-icon svg { width: 16px !important; height: 16px !important; max-width: 16px !important; max-height: 16px !important; display: block !important; }
.hdtp-popover {
  position: fixed !important; z-index: 99999 !important; width: 286px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 16px 48px rgba(80,66,38,.28);
  padding: 13px; font-family: var(--font); color: var(--text);
  animation: hdtpIn .12s ease-out; box-sizing: border-box;
}
@keyframes hdtpIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.hdtp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hdtp-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.hdtp-nav-btn {
  width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg-card-2); color: var(--text-dim); font-size: 16px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s;
}
.hdtp-nav-btn:hover:not(:disabled) { background: var(--bg-hover); border-color: #d8d2c2; color: var(--text); }
.hdtp-dows { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 10.5px; text-transform: uppercase; font-weight: 700; color: var(--text-mute); margin-bottom: 4px; }
.hdtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.hdtp-day {
  height: 29px; display: grid; place-items: center; font-size: 12px; font-weight: 500;
  border-radius: 7px; cursor: pointer; transition: background .12s, color .12s;
}
.hdtp-day:hover:not(.disabled):not(.out) { background: var(--bg-hover); }
.hdtp-day.out { color: var(--text-mute); opacity: .35; cursor: default; }
.hdtp-day.today { border: 1px solid var(--accent); color: var(--accent-3); font-weight: 700; }
.hdtp-day.selected { background: var(--accent) !important; color: #fff !important; font-weight: 700; }
.hdtp-day.disabled { color: #cfcaba; cursor: not-allowed; opacity: .45; background: none !important; }
.hdtp-time-wrap {
  display: flex; align-items: center; gap: 5px; padding: 9px 0 6px; margin-top: 8px;
  border-top: 1px solid var(--border-soft); font-size: 12px;
}
.hdtp-time-label { font-size: 11.5px; font-weight: 600; color: var(--text-dim); }
.hdtp-time-sel {
  background: var(--bg-card-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 6px; font-size: 12px; font-weight: 600; font-family: var(--font); color: var(--text);
  outline: none; cursor: pointer;
}
.hdtp-time-sel:focus { border-color: var(--accent); }
.hdtp-ampm-grp { display: inline-flex; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px; margin-left: auto; }
.hdtp-ampm-btn {
  border: none; background: none; font-size: 10.5px; font-weight: 700; font-family: var(--font);
  padding: 3px 6px; border-radius: 4px; color: var(--text-dim); cursor: pointer; transition: background .12s, color .12s;
}
.hdtp-ampm-btn.active { background: var(--accent); color: #fff; }
.hdtp-foot {
  display: flex; justify-content: space-between; align-items: center; margin-top: 6px;
  padding-top: 6px; border-top: 1px solid var(--border-soft);
}
.hdtp-btn-text {
  background: none; border: none; font-size: 11.5px; color: var(--accent-3); font-weight: 600;
  font-family: var(--font); cursor: pointer; padding: 4px 0;
}
.hdtp-btn-text:hover { text-decoration: underline; }
.hdtp-btn-done {
  background: var(--accent); color: #fff; border: none; border-radius: 7px;
  padding: 5px 12px; font-size: 11.5px; font-weight: 600; font-family: var(--font); cursor: pointer;
  transition: background .15s;
}
.hdtp-btn-done:hover { background: var(--accent-3); }

