/* Internal-only visual layer.
   Scope is strict: styles apply only when body has class "eb-admin-theme". */

body.eb-admin-theme {
  /* Premium Light Mode (Shadcn/Tailwind/Green Theme) */
  --bg: #f8fafc;
  /* slate-50 */
  --card: #ffffff;
  /* white */
  --border: #e2e8f0;
  /* slate-200 */
  --text: #0f172a;
  /* slate-900 */
  --muted: #64748b;
  /* slate-500 */
  --pri: #16a34a;
  /* green-600 (Primary) */
  --pri-lt: #dcfce7;
  /* green-100 */
  --ok: #16a34a;
  /* green-600 */
  --ok-lt: #dcfce7;
  /* green-100 */
  --err: #ef4444;
  /* red-500 */
  --err-lt: #fee2e2;
  /* red-100 */
  --warn: #f97316;
  /* orange-500 */
  --warn-lt: #ffedd5;
  /* orange-100 */
  --hdr: #ffffff;
  --row-alt: #f1f5f9;
  /* slate-100 */

  color: var(--text);
  background: var(--bg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body.eb-admin-theme .app-shell>.app-header,
body.eb-admin-theme .app-shell>.tab-bar,
body.eb-admin-theme .app-shell>.kpi-bar,
body.eb-admin-theme .app-shell>.kpi-hdr-bar,
body.eb-admin-theme .app-shell>.toolbar,
body.eb-admin-theme .app-shell>.toolbar-v2,
body.eb-admin-theme .app-shell>.panel,
body.eb-admin-theme>.app-header,
body.eb-admin-theme>.content,
body.eb-admin-theme>.bnav {
  margin-left: clamp(10px, 1.4vw, 18px);
  margin-right: clamp(10px, 1.4vw, 18px);
}

body.eb-admin-theme .app-shell>.app-header,
body.eb-admin-theme>.app-header {
  margin-top: clamp(10px, 1.2vw, 16px);
}

body.eb-admin-theme .app-shell>.panel,
body.eb-admin-theme>.content {
  margin-bottom: clamp(10px, 1.2vw, 16px);
}

body.eb-admin-theme .app-header,
body.eb-admin-theme .hdr {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

body.eb-admin-theme .header-actions button,
body.eb-admin-theme .hdr a {
  border: 1px solid rgba(151, 181, 234, 0.24);
  border-radius: 9px;
}

body.eb-admin-theme .tab-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

body.eb-admin-theme .tab {
  color: var(--muted);
}

body.eb-admin-theme .tab:hover {
  color: var(--text);
}

body.eb-admin-theme .tab.act {
  color: var(--pri);
  font-weight: 600;
  border-color: var(--pri);
}

body.eb-admin-theme .kpi-bar,
body.eb-admin-theme .kpi-hdr-bar,
body.eb-admin-theme .toolbar,
body.eb-admin-theme .toolbar-v2 {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

body.eb-admin-theme .panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

body.eb-admin-theme .C,
body.eb-admin-theme .sb,
body.eb-admin-theme .ac,
body.eb-admin-theme .del-card,
body.eb-admin-theme .modal,
body.eb-admin-theme .sheet-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

body.eb-admin-theme .panel table:not(.sheet) th {
  background: #f1f5f9;
}

body.eb-admin-theme .panel table:not(.sheet) td {
  border-bottom-color: var(--border);
}

body.eb-admin-theme table.sheet th {
  background: #f1f5f9;
  color: var(--muted);
  border-color: var(--border);
  font-weight: 600;
}

body.eb-admin-theme table.sheet td {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
}

body.eb-admin-theme table.sheet tr:nth-child(even) td {
  background: var(--row-alt);
}

body.eb-admin-theme table.sheet tr:hover td {
  background: rgba(77, 135, 255, 0.2) !important;
}

body.eb-admin-theme input,
body.eb-admin-theme select,
body.eb-admin-theme textarea {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
}

body.eb-admin-theme input::placeholder,
body.eb-admin-theme textarea::placeholder {
  color: rgba(164, 184, 216, 0.78);
}

body.eb-admin-theme input:focus,
body.eb-admin-theme select:focus,
body.eb-admin-theme textarea:focus {
  outline: none;
  border-color: rgba(112, 165, 255, 0.72);
  box-shadow: 0 0 0 2px rgba(77, 135, 255, 0.2);
}

body.eb-admin-theme input:disabled,
body.eb-admin-theme select:disabled,
body.eb-admin-theme textarea:disabled {
  background: var(--input-bg, rgba(12, 23, 40, 0.95));
  color: var(--text);
  opacity: 1;
  -webkit-text-fill-color: var(--text);
}

body.eb-admin-theme .btn,
body.eb-admin-theme .btn-s,
body.eb-admin-theme .tb-btn,
body.eb-admin-theme .t-act-btn,
body.eb-admin-theme .t-badge-btn {
  border-radius: 9px;
  box-shadow: 0 8px 16px rgba(2, 9, 22, 0.25);
}

body.eb-admin-theme .btn.bm,
body.eb-admin-theme .btn-ghost {
  background: var(--ok);
  color: #fff;
  border: none;
}

body.eb-admin-theme .tb-btn {
  background: var(--ok);
  color: #fff;
  border: none;
}

body.eb-admin-theme .bell {
  color: var(--muted);
}

body.eb-admin-theme .muted {
  color: var(--muted);
}

@media (max-width: 920px) {

  body.eb-admin-theme .app-shell>.app-header,
  body.eb-admin-theme .app-shell>.tab-bar,
  body.eb-admin-theme .app-shell>.kpi-bar,
  body.eb-admin-theme .app-shell>.kpi-hdr-bar,
  body.eb-admin-theme .app-shell>.toolbar,
  body.eb-admin-theme .app-shell>.toolbar-v2,
  body.eb-admin-theme .app-shell>.panel,
  body.eb-admin-theme>.app-header,
  body.eb-admin-theme>.content,
  body.eb-admin-theme>.bnav {
    margin-left: 8px;
    margin-right: 8px;
  }

  body.eb-admin-theme .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  body.eb-admin-theme .app-header,
  body.eb-admin-theme .hdr {
    height: auto;
    min-height: 52px;
    padding: 10px 12px;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }

  body.eb-admin-theme .app-header .logo,
  body.eb-admin-theme .hdr .logo {
    font-size: 16px;
  }

  body.eb-admin-theme .header-actions,
  body.eb-admin-theme .hdr-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  body.eb-admin-theme .tab-bar {
    padding: 0 8px;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.eb-admin-theme .tab {
    font-size: 11px;
    padding: 9px 10px;
  }

  body.eb-admin-theme .kpi-bar,
  body.eb-admin-theme .kpi-hdr-bar,
  body.eb-admin-theme .toolbar,
  body.eb-admin-theme .toolbar-v2 {
    padding: 8px 10px;
    gap: 8px;
  }

  body.eb-admin-theme .kpi-bar,
  body.eb-admin-theme .kpi-hdr-bar {
    overflow-x: auto;
    white-space: nowrap;
  }

  body.eb-admin-theme .panel>h2 {
    padding: 14px 14px 0;
    font-size: 16px;
  }

  body.eb-admin-theme .panel>.C,
  body.eb-admin-theme .panel>.fg,
  body.eb-admin-theme .panel>.fbar,
  body.eb-admin-theme .panel>.brow,
  body.eb-admin-theme .panel>button,
  body.eb-admin-theme .panel>div:not(.sheet-wrap):not(.an):not(.stg):not(.wizard):not(.fl) {
    margin-left: 12px;
    margin-right: 12px;
  }

  body.eb-admin-theme .fg {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.eb-admin-theme .fbar,
  body.eb-admin-theme .brow,
  body.eb-admin-theme .t-row {
    gap: 6px;
  }

  body.eb-admin-theme .tb-search,
  body.eb-admin-theme .tb-sel,
  body.eb-admin-theme .toolbar input,
  body.eb-admin-theme .toolbar select,
  body.eb-admin-theme .toolbar .tb-btn {
    width: 100%;
    min-width: 0 !important;
  }

  body.eb-admin-theme .t-row>div[style*="margin-left:auto"] {
    margin-left: 0 !important;
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px !important;
  }

  body.eb-admin-theme .t-row>div[style*="margin-left:auto"]>button {
    width: 100%;
    justify-content: center;
  }

  body.eb-admin-theme .t-actions .t-pg,
  body.eb-admin-theme .t-actions .t-count,
  body.eb-admin-theme .t-actions .t-add-btn {
    margin-left: 0;
  }

  body.eb-admin-theme .t-pg {
    width: 100%;
    justify-content: center;
  }

  body.eb-admin-theme .t-count {
    width: 100%;
    text-align: left;
  }

  body.eb-admin-theme .t-add-btn {
    width: 100%;
  }

  body.eb-admin-theme .content {
    padding: 12px;
    padding-bottom: 92px;
  }

  body.eb-admin-theme .bnav {
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
  }
}

@media (max-width: 520px) {
  body.eb-admin-theme .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.eb-admin-theme .t-row>div[style*="margin-left:auto"] {
    grid-template-columns: 1fr;
  }

  body.eb-admin-theme .del-card {
    flex-direction: column;
    align-items: flex-start;
  }

  body.eb-admin-theme .del-actions {
    width: 100%;
  }

  body.eb-admin-theme .del-actions button {
    flex: 1;
  }
}