/* Shilpi BO Operator Portal — Pazy.io-inspired green theme (matches Home-deploy) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --c-primary: #0E9F6E;
  --c-primary-dark: #057A55;
  --c-primary-soft: #DEF7EC;
  --c-primary-softer: #F3FAF7;

  --c-text: #111928;
  --c-text-soft: #374151;
  --c-muted: #6B7280;
  --c-muted-soft: #9CA3AF;
  --c-border: #E5E7EB;
  --c-border-soft: #F3F4F6;

  --c-bg: #FFFFFF;
  --c-bg-soft: #F9FAFB;
  --c-bg-page: #FAFBFC;

  --c-success: #0E9F6E;
  --c-success-dark: #057A55;
  --c-success-soft: #DEF7EC;
  --c-warning: #C27803;
  --c-warning-soft: #FDF6B2;
  --c-danger: #E02424;
  --c-danger-dark: #C81E1E;
  --c-danger-soft: #FDE8E8;
  --c-info: #1A56DB;
  --c-info-soft: #E1EFFE;

  --slate-50:#f9fafb; --slate-100:#f3f4f6; --slate-200:#e5e7eb;
  --slate-300:#d1d5db; --slate-400:#9ca3af; --slate-500:#6b7280;
  --slate-600:#4b5563; --slate-700:#374151; --slate-800:#1f2937; --slate-900:#111928;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08);

  --r-sm: 8px; --r: 10px; --r-md: 12px; --r-lg: 16px; --r-pill: 100px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-num: 'Inter', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--c-bg-page);
  color: var(--c-text);
  margin: 0;
  line-height: 1.55;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; letter-spacing: -0.015em; margin: 0; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); text-decoration: none; }

/* ========== LOGIN ========== */
.login-body {
  background: linear-gradient(135deg, var(--c-primary-softer) 0%, #DEF7EC 100%);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.login-shell { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.brand { text-align: center; margin-bottom: 28px; }
.brand-mark {
  font-size: 30px; font-weight: 800; letter-spacing: 4px;
  color: var(--c-primary-dark);
}
.brand-sub { font-size: 11px; color: var(--c-muted); text-transform: uppercase; letter-spacing: 2px; margin-top: 6px; }
.login-form label { display: block; margin-bottom: 14px; }
.login-form label > span {
  display: block; font-size: 11px; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; font-weight: 600;
}
.login-form input, .login-form select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--c-border); border-radius: var(--r-sm);
  font-size: 14px; font-family: inherit; background: #fff; color: var(--c-text);
}
.login-form input:focus, .login-form select:focus {
  outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft);
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 13.5px; line-height: 1.3;
  border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: all .15s ease; white-space: nowrap;
  font-family: inherit;
}
.btn-primary {
  background: var(--c-primary); color: #fff; border-color: var(--c-primary);
}
.btn-primary:hover {
  background: var(--c-primary-dark); border-color: var(--c-primary-dark);
  box-shadow: var(--shadow-sm); color: #fff;
}
.btn-outline {
  background: #fff; color: var(--c-text); border-color: var(--c-border);
}
.btn-outline:hover { border-color: var(--c-text); background: var(--c-bg-soft); }
.btn-ghost {
  background: transparent; border-color: transparent; color: var(--c-text-soft);
}
.btn-ghost:hover { background: var(--c-bg-soft); }
.btn-danger-outline {
  background: #fff; color: var(--c-danger); border-color: var(--c-danger);
}
.btn-danger-outline:hover { background: var(--c-danger-soft); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ========== TWO-ROW TOP NAV (Home-deploy style) ========== */
.dash-page-bg {
  min-height: 100vh;
  background: var(--c-bg-page);
  display: flex; flex-direction: column;
}
.dash-page-bg .page { flex: 1 0 auto; }

.dash-topnav {
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 50;
}
.dt-row1 {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; gap: 24px;
  max-width: 1600px; margin: 0 auto;
}
.dt-row2 {
  max-width: 1600px; margin: 0 auto;
  padding: 0 24px;
  display: flex; gap: 4px;
  border-top: 1px solid var(--c-border-soft);
  flex-wrap: wrap;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px;
  color: var(--c-text);
  text-decoration: none; letter-spacing: -0.01em;
}
.brand .logo {
  width: 32px; height: 32px;
  background: var(--c-primary);
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
}

.dt-search {
  flex: 1; max-width: 400px; position: relative;
}
.dt-search input {
  width: 100%; padding: 9px 12px 9px 36px;
  border: 1px solid var(--c-border); border-radius: var(--r-sm);
  font-size: 14px; background: var(--c-bg-soft);
  font-family: inherit; color: var(--c-text);
}
.dt-search input:focus {
  outline: none; background: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.dt-search input::placeholder { color: var(--c-muted-soft); }
.dt-search .s-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--c-muted-soft); font-size: 14px; pointer-events: none;
}

.dt-actions { display: flex; align-items: center; gap: 12px; }

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--c-bg-soft); border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  font-size: 13px; color: var(--c-text);
  cursor: pointer; font-family: inherit;
}
.user-chip:hover { background: var(--c-primary-softer); border-color: var(--c-primary-soft); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.db-pill {
  font-size: 12px; padding: 5px 12px;
  background: var(--c-primary-soft); color: var(--c-primary-dark);
  border-radius: var(--r-pill); font-weight: 600;
  border: 1px solid var(--c-primary-soft);
}

.dt-nav-item {
  padding: 14px 14px;
  border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--c-muted); font-weight: 500; font-size: 14px;
  white-space: nowrap; cursor: pointer;
  background: transparent; font-family: inherit;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.dt-nav-item:hover { color: var(--c-text); text-decoration: none; }
.dt-nav-item.active {
  color: var(--c-primary-dark);
  border-bottom-color: var(--c-primary);
  font-weight: 600;
}

/* ========== PAGE LAYOUT ========== */
.page {
  max-width: none; margin: 0;
  padding: 28px 32px;
}
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  margin-bottom: 24px;
}
.page-title { font-size: 24px; color: var(--c-text); margin-bottom: 4px; font-weight: 700; }
.page-subtitle { font-size: 14px; color: var(--c-muted); }
.page-actions { display: flex; gap: 8px; align-items: center; }

.crumb { font-size: 12px; color: var(--c-muted); margin-top: 4px; }
.src {
  font-family: var(--font-num); background: var(--c-bg-soft);
  padding: 2px 7px; border-radius: 4px; font-size: 11px; color: var(--c-text-soft);
  border: 1px solid var(--c-border-soft);
}

/* ========== STAT CARDS ========== */
.stats-row {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 1280px) { .stats-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .stats-row { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: #fff; border: 1px solid var(--c-border-soft); border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  transition: all 0.15s;
}
.stat-card:hover { border-color: var(--c-primary-soft); box-shadow: var(--shadow-sm); }
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--r-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
}
.stat-icon.primary { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.stat-icon.success { background: var(--c-success-soft); color: var(--c-success-dark); }
.stat-icon.warning { background: var(--c-warning-soft); color: var(--c-warning); }
.stat-icon.danger  { background: var(--c-danger-soft); color: var(--c-danger-dark); }
.stat-icon.info    { background: var(--c-info-soft); color: var(--c-info); }
.stat-icon.slate   { background: var(--slate-100); color: var(--slate-700); }

.stat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 11px; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat-value { font-family: var(--font-num); font-size: 20px; font-weight: 700; color: var(--c-text); }
.stat-value.pos { color: var(--c-success-dark); }
.stat-value.neg { color: var(--c-danger-dark); }

/* ========== FILTER BAR ========== */
.filter-bar {
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-bar label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--c-muted); font-weight: 600;
}
.filter-bar input, .filter-bar select {
  padding: 8px 11px; border: 1px solid var(--c-border); border-radius: var(--r-sm);
  font-size: 13px; font-family: inherit;
  text-transform: none; letter-spacing: normal; color: var(--c-text);
  background: #fff; min-width: 110px;
}
.filter-bar input:focus, .filter-bar select:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.filter-bar .btn-primary { padding: 8px 18px; font-size: 13px; }

/* ========== CHIP RADIO GROUPS (segmented control) ========== */
.chip-group {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0;
  border: 0; padding: 0; margin: 0;
}
.chip-group legend {
  flex: 0 0 100%;
  font-size: 11px; font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 0 0 5px 0; padding: 0;
}

/* render the radios as segmented buttons by hiding native input */
.chip {
  display: inline-flex; cursor: pointer;
}
.chip input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.chip span {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 13px; border: 1px solid var(--c-border); border-right: 0;
  font-size: 13px; font-weight: 500; color: var(--c-text-soft);
  background: #fff; transition: all .15s;
  white-space: nowrap;
}
.chip:first-of-type span { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.chip:last-of-type  span { border-radius: 0 var(--r-sm) var(--r-sm) 0; border-right: 1px solid var(--c-border); }
.chip:only-of-type  span { border-radius: var(--r-sm); border-right: 1px solid var(--c-border); }
.chip:hover span { background: var(--c-bg-soft); color: var(--c-text); }
.chip input:checked + span {
  background: var(--c-primary); color: #fff; border-color: var(--c-primary);
}
.chip input:focus-visible + span {
  outline: 2px solid var(--c-primary-soft); outline-offset: 2px;
}

/* Search cell wider */
.search-cell input { font-size: 14px; }

/* ========== MORE FILTERS COLLAPSIBLE ========== */
.more-filters {
  width: 100%;
  margin-top: 8px;
  border-top: 1px dashed var(--c-border);
  padding-top: 12px;
}
.more-filters > summary {
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  color: var(--c-primary-dark);
  padding: 4px 10px; border-radius: var(--r-sm);
  list-style: none;
  user-select: none;
}
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters > summary::before {
  content: "▸"; font-size: 11px;
  transition: transform .15s;
  display: inline-block;
}
.more-filters[open] > summary::before { transform: rotate(90deg); }
.more-filters > summary:hover { background: var(--c-primary-softer); }
.more-grid {
  display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap;
  margin-top: 12px;
}
.more-grid label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--c-muted); font-weight: 600;
}
.more-grid input, .more-grid select {
  padding: 8px 11px; border: 1px solid var(--c-border); border-radius: var(--r-sm);
  font-size: 13px; font-family: inherit;
  text-transform: none; letter-spacing: normal; color: var(--c-text);
  background: #fff;
}
.more-grid input:focus, .more-grid select:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}

/* Filter bar wraps on small screens */
.np-filters { gap: 14px 16px; }

/* ========== TABLE SEARCH — direct flex sibling of buttons (aligns with them) ========== */
.table-search-input {
  width: 260px;
  padding: 8px 12px;
  border: 1px solid var(--c-border); border-radius: var(--r-sm);
  font-size: 13px; font-family: inherit; line-height: 1.3;
  background: var(--c-bg-soft); color: var(--c-text);
  margin-left: 8px;
  height: 36px; box-sizing: border-box;
}
.table-search-input:focus {
  outline: none; background: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.table-search-input::placeholder { color: var(--c-muted-soft); }
.table-search-input::-webkit-search-cancel-button {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--c-muted-soft);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>") center / contain no-repeat;
  cursor: pointer;
}
.ts-count {
  font-size: 11.5px; color: var(--c-muted); font-variant-numeric: tabular-nums;
  white-space: nowrap; align-self: center;
}

/* ========== TABLE ========== */
.table-card {
  background: #fff;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-md);
  overflow: hidden;
}
.table-wrap { overflow-x: auto; }
table.report {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 1200px;
}
table.report thead th {
  background: var(--c-bg-soft);
  color: var(--c-text-soft);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
table.report tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border-soft);
  vertical-align: middle;
  white-space: nowrap;
}
table.report .scrip-cell .sym,
table.report .client-cell .name {
  white-space: normal;
}
table.report tbody tr:hover { background: var(--c-bg-soft); }
table.report tbody tr:last-child td { border-bottom: 0; }
table.report .num {
  text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums;
  font-weight: 500; white-space: nowrap;
}
table.report .pos { color: var(--c-success-dark); font-weight: 600; }
table.report .neg { color: var(--c-danger-dark); font-weight: 600; }
table.report tr.totals { background: var(--c-primary-softer); font-weight: 600; }
table.report tr.totals td { border-top: 2px solid var(--c-primary); border-bottom: 0; }

.client-cell { display: flex; flex-direction: column; gap: 1px; }
.client-cell .code { font-family: var(--font-num); font-weight: 600; color: var(--c-text); font-size: 12.5px; }
.client-cell .name { font-size: 12px; color: var(--c-muted); }

.scrip-cell { display: flex; flex-direction: column; gap: 1px; }
.scrip-cell .sym { font-weight: 600; color: var(--c-text); }
.scrip-cell .meta { font-size: 11px; color: var(--c-muted); font-family: var(--font-num); }

/* badge */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
  border: 1px solid transparent;
}
.badge.slate   { background: var(--slate-100); color: var(--slate-700); border-color: var(--slate-200); }
.badge.primary { background: var(--c-primary-soft); color: var(--c-primary-dark); border-color: var(--c-primary-soft); }
.badge.success { background: var(--c-success-soft); color: var(--c-success-dark); }
.badge.warn    { background: var(--c-warning-soft); color: #92400e; }
.badge.danger  { background: var(--c-danger-soft); color: var(--c-danger-dark); }

/* alert */
.alert {
  padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 16px;
  font-size: 13px; line-height: 1.5; display: flex; gap: 10px; align-items: flex-start;
}
.alert.warn { background: var(--c-warning-soft); border: 1px solid #fde68a; color: #78350f; }
.alert code { font-family: var(--font-num); background: rgba(255,255,255,0.6); padding: 0 5px; border-radius: 3px; font-size: 12px; }

/* report footer */
.report-foot {
  margin-top: 14px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 12px; color: var(--c-muted);
}


/* ========== SETTINGS PAGE ========== */
.settings-wrap { display: flex; flex-direction: column; gap: 20px; max-width: 1080px; }
.settings-card {
  background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.settings-head {
  padding: 18px 24px 6px;
  border-bottom: 1px solid var(--c-border-soft);
}
.settings-head h2 {
  font-size: 16px; font-weight: 700; color: var(--c-primary-dark);
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.settings-head .ico { font-size: 16px; }
.settings-head .sub { font-size: 12.5px; color: var(--c-muted); margin: 6px 0 14px; line-height: 1.5; }

.settings-body { padding: 20px 24px 24px; }
.settings-body .row {
  display: flex; flex-wrap: wrap; gap: 18px 24px;
  margin-bottom: 12px;
}
.settings-body .row:last-child { margin-bottom: 0; }
.settings-body .field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 220px; }
.settings-body .field label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
  color: var(--c-muted); text-transform: uppercase;
}
.settings-body .field input[type="text"] {
  height: 38px; padding: 0 12px;
  border: 1px solid var(--c-border); border-radius: var(--r);
  font-size: 14px; color: var(--c-text); background: #fff;
  font-family: var(--font);
}
.settings-body .field input[type="text"]:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.settings-body .field.readonly input { background: var(--c-bg-soft); color: var(--c-muted); }
.settings-body .input-group { display: flex; gap: 0; }
.settings-body .input-group input[type="text"] {
  flex: 1; border-top-right-radius: 0; border-bottom-right-radius: 0;
  border-right: 0;
}
.settings-body .input-group .btn {
  border-top-left-radius: 0; border-bottom-left-radius: 0;
  white-space: nowrap; height: 38px;
}
.settings-body .hint {
  font-size: 12px; color: var(--c-muted); line-height: 1.5;
  padding: 4px 2px;
}
.settings-body .hint.ok  { color: var(--c-success-dark); font-weight: 500; }
.settings-body .hint.err { color: var(--c-danger-dark); font-weight: 500; }
.settings-body .hint code {
  font-family: var(--font-num); background: var(--c-bg-soft);
  padding: 1px 5px; border-radius: 3px; font-size: 11.5px;
}

.btn.btn-success {
  background: var(--c-success); color: #fff; border: 1px solid var(--c-success);
}
.btn.btn-success:hover { background: var(--c-success-dark); border-color: var(--c-success-dark); }

