/* ══ RESET ══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { zoom: 90%; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px; line-height: 1.3;
  background: #f0f2f5; color: #1a1a2e;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ══ TOPBAR ══ */
.topbar {
  display: flex; align-items: center; gap: 18px;
  background: #0d3b66; color: #fff; padding: 10px 20px;
  flex-wrap: wrap; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.topbar-brand { font-weight: 700; font-size: 16px; white-space: nowrap; }
.topbar-brand span { color: #7fc8f8; }
.topbar-links { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topbar-link {
  padding: 6px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  opacity: .85; transition: background .15s, opacity .15s; white-space: nowrap;
}
.topbar-link:hover { background: rgba(255,255,255,.12); opacity: 1; }
.topbar-link.active { background: rgba(255,255,255,.2); opacity: 1; }
.topbar-clock { font-size: 12px; opacity: .75; white-space: nowrap; }
.topbar-user { font-size: 12px; opacity: .9; white-space: nowrap; margin-left: 4px; }
.topbar-user a { color: #7fc8f8; margin-left: 8px; text-decoration: none; }
.topbar-user a:hover { text-decoration: underline; }

/* ══ LAYOUT ══ */
.page { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; font-weight: 700; color: #0d3b66; }
.page-head p.sub { font-size: 12.5px; color: #667; margin-top: 2px; }

/* ══ CARDS / PANELS ══ */
.panel { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06); padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; font-weight: 700; color: #0d3b66; margin-bottom: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06); border-left: 4px solid #0d3b66; }
.stat-card .num { font-size: 24px; font-weight: 800; color: #0d3b66; }
.stat-card .label { font-size: 12px; color: #667; margin-top: 2px; }
.stat-card.warn { border-left-color: #b05e00; }
.stat-card.warn .num { color: #b05e00; }
.stat-card.danger { border-left-color: #c0392b; }
.stat-card.danger .num { color: #c0392b; }

/* ══ FORMS ══ */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 11.5px; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select, .field textarea {
  padding: 9px 11px; border: 1.5px solid #dde1e7; border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fafafa; outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #0d3b66; background: #fff; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.autocomplete-wrap { position: relative; }
.ac-box { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #dde1e7; border-radius: 6px; max-height: 220px; overflow-y: auto; z-index: 20; box-shadow: 0 4px 14px rgba(0,0,0,.12); display: none; }
.ac-item { padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f2f5; }
.ac-item:hover, .ac-item.active { background: #eef4fb; }
.ac-sub { color: #889; font-size: 11px; margin-left: 8px; }
.ac-empty { padding: 10px 12px; font-size: 12.5px; color: #889; }

/* ══ BUTTONS ══ */
.btn-primary, .btn-secondary, .btn-danger {
  padding: 9px 16px; border-radius: 6px; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer; font-family: inherit; transition: opacity .15s, background .15s;
}
.btn-primary { background: #0d3b66; color: #fff; }
.btn-primary:hover { background: #124a80; }
.btn-secondary { background: #eef1f5; color: #0d3b66; border: 1.5px solid #dde1e7; }
.btn-secondary:hover { background: #e3e8ee; }
.btn-danger { background: #fdecea; color: #c0392b; border: 1.5px solid #f5c6c0; }
.btn-danger:hover { background: #fbdcd8; }
button:disabled, .btn-primary:disabled, .btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ══ TABLES ══ */
table.dtbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dtbl th { text-align: left; padding: 9px 10px; background: #f5f7fa; color: #445; font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; border-bottom: 2px solid #e3e8ee; }
table.dtbl td { padding: 9px 10px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
table.dtbl tr.empty td { text-align: center; color: #889; padding: 28px 10px; }
table.dtbl tbody tr:hover { background: #f8fafc; }

/* ══ CASE GROUPING (Sendouts table) ══ */
tr.en-group-row { cursor: pointer; }
tr.en-group-row td { border-top: 2px solid #c3cede; border-left: 3px solid transparent; }
table.dtbl tbody tr:first-child td { border-top: none; }
tr.en-group-row.expanded td { background: #eef4fb; }
tr.en-group-row.expanded td:first-child { border-left: 3px solid #0d3b66; }
tr.en-child-row { cursor: pointer; background: #f8fafd; }
tr.en-child-row td { border-top: 1px solid #eef1f5; }
tr.en-child-row td:first-child { border-left: 3px solid #0d3b66; }
tr.en-child-row.case-end td { border-bottom: 2px solid #c3cede; }

/* ══ RECOLLECT LINKING ══ */
.attempt-tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px; margin-left: 6px; white-space: nowrap; vertical-align: middle; }
.attempt-tag.original { background: #fdecea; color: #c0392b; }
.attempt-tag.recollect { background: #e3edfa; color: #0d3b66; }
.link-note { font-size: 11px; color: #889; margin-top: 2px; }
.link-note a { color: #0d3b66; font-weight: 600; }

/* ══ BADGES ══ */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-blue { background: #e3edfa; color: #0d3b66; }
.badge-orange { background: #fdecd8; color: #b05e00; }
.badge-green { background: #e2f5e9; color: #1e7e34; }
.badge-red { background: #fdecea; color: #c0392b; }
.badge-gray { background: #eef0f2; color: #556; }
.badge-purple { background: #f1e8fb; color: #6a3fa0; }

/* ══ INFO BOX ══ */
.info-box { background: #f5f8fc; border: 1.5px solid #dde7f3; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.info-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.info-row.total { border-top: 1.5px dashed #c8d4e3; margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 14.5px; color: #0d3b66; }

/* ══ MODAL ══ */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,20,35,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 200; }
.modal-box { background: #fff; border-radius: 12px; max-width: 760px; width: 100%; padding: 22px 24px; max-height: 85vh; overflow-y: auto; }
.modal-box h2 { color: #0d3b66; font-size: 17px; margin-bottom: 4px; }
.modal-box .sub { color: #667; font-size: 12.5px; margin-bottom: 14px; }
.modal-close { float: right; cursor: pointer; background: #eef1f5; border: none; border-radius: 6px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; color: #0d3b66; }
.stat-card { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }

/* ══ PAGER (reused pattern) ══ */
.lt-pager-info { font-size: 12px; color: #667; }
.lt-pager-btns { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.lt-pager-page { font-size: 12.5px; font-weight: 600; color: #445; }

/* ══ SEARCH BAR ══ */
.search-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search-bar input[type="text"], .search-bar input[type="date"], .search-bar select { padding: 8px 11px; border: 1.5px solid #dde1e7; border-radius: 6px; font-size: 13.5px; }

/* ══ NOTIFICATION WIDGET (dashboard) ══ */
.hm-notif-bell { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); cursor: pointer; font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.hm-notif-alert { border-left: 4px solid #c0392b; }
.hm-notif-empty { cursor: default; color: #667; font-weight: 500; }
.hm-notif-table-wrap { margin: -4px 0 12px; }

/* ══ MISC ══ */
.wip { text-align: center; padding: 50px 20px; color: #889; }
.wip-icon { font-size: 36px; margin-bottom: 10px; }
.footnote { font-size: 11.5px; color: #889; margin-top: 6px; }
