/* ==========================================================================
   Mr. T's Money Machine: console stylesheet
   --------------------------------------------------------------------------
   Modelled on the ella Hub console: a black icon rail, a white top bar, a
   light-grey page and white cards. ONE accent colour; everything else on a
   working screen is neutral or is a status. Loaded after Bootstrap and
   DataTables so these rules win, and versioned by filemtime in the layout.
   ========================================================================== */

:root {
  /* The accent: one hue, on-light and on-dark variants */
  --accent:         #5B52C8;
  --accent-strong:  #4B43A4;
  --accent-on-dark: #A99CF5;
  --accent-tint:    #EBEAF8;
  --accent-rgb:     91, 82, 200;
  --mark:           #43FFBB;   /* the active marker on the black rail */

  /* Neutrals */
  --ink:           #0B0B12;
  --slate:         #4A5168;
  --slate-light:   #656B83;
  --faint:         #9AA0B4;
  --bg:            #F7F7F7;
  --surface:       #FFFFFF;
  --border:        #E5E7EB;
  --border-strong: #D6D6E4;
  --rail:          #000000;
  --rail-line:     #1E1E2A;

  /* Status: the fill is painted, the ink is read */
  --success: #16A34A; --success-bg: #DCFCE7; --success-ink: #15803D;
  --warning: #D97706; --warning-bg: #FEF3C7; --warning-ink: #78350F;
  --danger:  #DC2626; --danger-bg:  #FFF1F2; --danger-ink:  #B02A37;
  --info:    #0891B2; --info-bg:    #DBEAFE; --info-ink:    #155E75;

  /* Shape */
  --radius: 8px; --radius-sm: 6px; --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow:    0 5px 15px rgba(0, 0, 0, .08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .10);

  /* Frame */
  --rail-w: 64px;
  --rail-open-w: 248px;
  --topbar-h: 64px;

  /* Bootstrap, in its own vocabulary */
  --bs-primary: var(--accent);
  --bs-primary-rgb: var(--accent-rgb);
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: var(--accent-rgb);
  --bs-link-hover-color: var(--accent-strong);
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--slate-light);
  --bs-border-radius: var(--radius);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius);
  --bs-success: var(--success);
  --bs-danger: var(--danger);
  --bs-warning: var(--warning);
  --bs-info: var(--info);
}

/* ---- Base --------------------------------------------------------------- */

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--bs-body-font-family);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.2; margin-bottom: 6px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 16px; font-weight: 600; }
h6 { font-size: 14px; font-weight: 600; }
/* Page titles carry no icon: the rail already says where you are. */
h1 > i:first-child, h1 > .fas:first-child, h1 > .fa:first-child { display: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
small, .small { font-size: 13px; }
.text-muted { color: var(--slate-light) !important; }
code { color: var(--accent-strong); background: var(--accent-tint); padding: 1px 5px; border-radius: 4px; font-size: .86em; }
hr { border-color: var(--border); opacity: 1; }
.prose { max-width: 72ch; }

/* ---- The frame: rail + top bar + page ---------------------------------- */

.app-rail {
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  width: var(--rail-w);
  background: var(--rail);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width .18s ease, box-shadow .18s ease;
}
.app-rail-brand {
  height: var(--topbar-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--rail-line);
  color: #fff; white-space: nowrap; text-decoration: none;
}
.app-rail-brand:hover { color: #fff; }
.app-rail-brand img { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; }
.app-rail-brand span { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.app-rail-nav {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  padding: 10px 0 14px;
  scrollbar-width: none;
}
.app-rail-nav::-webkit-scrollbar { display: none; }
.rail-group { padding: 6px 0; }
.rail-group + .rail-group { border-top: 1px solid var(--rail-line); }
.rail-group-label {
  height: 0; overflow: hidden; opacity: 0;
  padding: 0 22px; font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: #6E6E86;
  white-space: nowrap; transition: opacity .15s ease;
}
.rail-link {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  height: 44px; padding: 0 22px;
  color: #C9C9D6; white-space: nowrap; text-decoration: none;
  font-size: 14px; font-weight: 500;
}
.rail-link i { width: 20px; flex: 0 0 auto; text-align: center; font-size: 16px; }
.rail-link span { opacity: 0; transition: opacity .12s ease; }
.rail-link .rail-meta { margin-left: auto; font-size: 11px; color: #8A8AA0; }
.rail-link:hover { color: #fff; background: #111118; }
.rail-link.active { color: #fff; background: #17171F; }
.rail-link.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--mark);
}
/* Account sits at the foot of the rail, away from the daily work */
.rail-group-account { margin-top: auto; }

/* Flyouts: a parent row whose children open beside the rail. The panel is
   position: fixed so the rail's overflow cannot clip it; JS sets its top. */
.rail-flyout-arrow { margin-left: auto; width: auto !important; font-size: 10px !important; opacity: 0; color: #8A8AA0; transition: opacity .12s ease; }
.rail-item.has-flyout.flyout-active > .rail-link { color: #fff; background: #17171F; }
.rail-flyout {
  position: fixed; left: var(--rail-open-w); top: 0; margin-left: 6px; min-width: 220px; padding: 8px;
  background: #0E0E16; border: 1px solid rgba(255, 255, 255, .09); border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden; transform: translateX(-6px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s; z-index: 1050;
}
/* A bridge over the gap, so moving the pointer across does not close it */
.rail-flyout::before { content: ''; position: absolute; left: -12px; top: 0; width: 12px; height: 100%; }
.rail-item.has-flyout:hover > .rail-flyout,
.rail-item.has-flyout:focus-within > .rail-flyout { opacity: 1; visibility: visible; transform: none; }
.rail-flyout-title { padding: 6px 12px 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6E6E86; }
.rail-flyout-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: #C9C9D6; font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none;
}
.rail-flyout-link i { width: 18px; text-align: center; opacity: .85; }
.rail-flyout-link .rail-meta { margin-left: auto; padding-left: 16px; font-size: 11px; color: #8A8AA0; }
.rail-flyout-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.rail-flyout-link.active { color: #fff; background: rgba(var(--accent-rgb), .35); }
.rail-flyout-link.active i { opacity: 1; color: var(--mark); }

.rail-dot { position: absolute; left: 34px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: #F43F5E; }

/* Desktop: hover opens the rail over the page */
@media (min-width: 768px) {
  .app-rail:hover, .app-rail:focus-within {
    width: var(--rail-open-w);
    box-shadow: 12px 0 40px rgba(0, 0, 0, .25);
  }
  .app-rail:hover .rail-link span, .app-rail:focus-within .rail-link span,
  .app-rail:hover .rail-group-label, .app-rail:focus-within .rail-group-label { opacity: 1; }
  .app-rail:hover .rail-group-label, .app-rail:focus-within .rail-group-label { height: 24px; line-height: 24px; }
  .app-rail-brand span { opacity: 0; transition: opacity .12s ease; }
  .app-rail:hover .app-rail-brand span, .app-rail:focus-within .app-rail-brand span { opacity: 1; }
  .app-rail:hover .rail-flyout-arrow, .app-rail:focus-within .rail-flyout-arrow { opacity: 1; }
}

.app-topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--topbar-h);
  margin-left: var(--rail-w);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; color: var(--slate-light); }
.app-crumbs a { color: var(--slate-light); white-space: nowrap; }
.app-crumbs .crumb-parent { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-crumbs a .fa-house { font-size: 14px; }
.app-crumbs a:hover { color: var(--ink); }
.app-crumbs .sep { color: var(--faint); font-size: 11px; }
.app-crumbs .current { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: var(--slate); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--border-strong); }
.topbar-link { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; color: var(--slate); border-radius: var(--radius); font-weight: 500; font-size: 14px; }
.topbar-link:hover, .topbar-link[aria-expanded="true"] { color: var(--ink); background: var(--bg); }
.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 6px 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); text-align: right;
}
.user-chip:hover { border-color: var(--border-strong); color: var(--ink); }
.user-chip .who { line-height: 1.15; }
.user-chip .who b { display: block; font-size: 14px; font-weight: 600; }
.user-chip .who small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-light); }
.user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px;
}
.etsy-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: var(--radius-pill); background: var(--success-bg); color: var(--success-ink);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.etsy-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.app-main {
  margin-left: var(--rail-w);
  padding: 28px 32px 40px;
  min-height: calc(100vh - var(--topbar-h));
}
.app-footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; text-align: center; }
.app-footer a { color: var(--slate-light); margin: 0 8px; }

.rail-backdrop { display: none; }
.rail-toggle { display: none; }

/* Phone: the rail is a drawer, off-screen until the hamburger opens it */
@media (max-width: 767.98px) {
  .app-rail { width: min(86vw, 300px); transform: translateX(-100%); transition: transform .2s ease; }
  .app-rail .rail-link span, .app-rail .rail-group-label { opacity: 1; }
  .app-rail .rail-group-label { height: 24px; line-height: 24px; }
  /* No room beside a drawer: the children sit inline under their parent */
  .rail-flyout { position: static; margin: 0 0 4px; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none;
    opacity: 1; visibility: visible; transform: none; transition: none; }
  .rail-flyout::before, .rail-flyout-title, .rail-flyout-arrow { display: none; }
  .rail-flyout-link { height: 38px; padding: 0 22px 0 56px; border-radius: 0; font-size: 13px; }
  .rail-flyout-link i { display: none; }
  .rail-flyout-link.active { background: #17171F; }
  body.rail-open .app-rail { transform: none; box-shadow: var(--shadow-lg); }
  body.rail-open .rail-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(11, 11, 18, .45); }
  .rail-toggle { display: inline-flex; }
  .app-topbar { margin-left: 0; padding: 0 14px; gap: 10px; }
  .app-main { margin-left: 0; padding: 20px 16px 32px; }
  .app-crumbs .crumb-far { display: none; }
  .app-crumbs .crumb-parent { max-width: 34vw; }
  .user-chip { padding: 0 4px; }
  .user-chip .who, .etsy-pill { display: none !important; }
  h1 { font-size: 24px; }
}

/* ---- Page header -------------------------------------------------------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-sub { color: var(--slate); margin: 6px 0 0; max-width: 72ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Most views still use Bootstrap's flex header; give it the same rhythm. */
.app-main > .d-flex.justify-content-between.align-items-center:first-child,
.app-main > .d-flex.justify-content-between:first-child { flex-wrap: wrap; gap: 12px; }

/* ---- Cards -------------------------------------------------------------- */

.card {
  --bs-card-bg: var(--surface);
  --bs-card-border-color: var(--border);
  --bs-card-border-radius: var(--radius);
  --bs-card-inner-border-radius: calc(var(--radius) - 1px);
  --bs-card-cap-bg: var(--surface);
  --bs-card-spacer-y: 18px;
  --bs-card-spacer-x: 20px;
  --bs-card-cap-padding-y: 14px;
  --bs-card-cap-padding-x: 20px;
  box-shadow: none;
}
.card-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.card-header h5, .card-header .h5, .card-title { font-size: 16px; font-weight: 600; margin: 0; }
.card-header h5 i, .card-header .h5 i { color: var(--slate-light); margin-right: 4px; font-size: 14px; }
.card-footer { background: var(--surface); border-top: 1px solid var(--border); }
.list-group { --bs-list-group-bg: var(--surface); --bs-list-group-border-color: var(--border); }
.list-group-item-action:hover { background: var(--bg); }

/* Stat tiles: big figure, small uppercase label */
.stat-card, .stat-tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  height: 100%;
  box-shadow: none;
  transition: border-color .15s ease;
}
.stat-card::before { content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; border-radius: var(--radius) var(--radius) 0 0; background: var(--accent); }
.stat-card.tone-warning::before { background: var(--warning); }
.stat-card.tone-success::before { background: var(--success); }
.stat-card.tone-danger::before { background: var(--danger); }
.stat-card.tone-neutral::before { background: var(--border-strong); }
a > .stat-card:hover, .stat-card:hover { border-color: var(--border-strong); }
.stat-card h3, .stat-card .figure { font-size: 30px; font-weight: 700; line-height: 1.1; margin: 0 0 6px; color: var(--ink); letter-spacing: -0.02em; }
.stat-card p, .stat-card .label { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-light); }
.stat-card small { display: block; margin-top: 4px; color: var(--faint); font-size: 12px; }

/* ---- Buttons -------------------------------------------------------------
   The default button is white with a hairline border and ink text; filled
   accent is kept for the one primary action on a screen. */

.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-font-size: 14px;
  --bs-btn-padding-y: 8px;
  --bs-btn-padding-x: 14px;
  --bs-btn-border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: none;
  white-space: nowrap;
}
@media (max-width: 767.98px) { .btn.w-100, .d-grid > .btn { white-space: normal; } }
.btn i { font-size: 13px; }
.btn-sm { --bs-btn-padding-y: 5px; --bs-btn-padding-x: 10px; --bs-btn-font-size: 13px; gap: 6px; }
.btn-lg { --bs-btn-padding-y: 11px; --bs-btn-padding-x: 20px; --bs-btn-font-size: 15px; }
.btn-primary {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-strong); --bs-btn-hover-border-color: var(--accent-strong);
  --bs-btn-active-bg: var(--accent-strong); --bs-btn-active-border-color: var(--accent-strong);
  --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent);
  --bs-btn-focus-shadow-rgb: var(--accent-rgb);
}
.btn-outline-primary, .btn-outline-secondary, .btn-light, .btn-outline-dark, .btn-secondary {
  --bs-btn-color: var(--ink); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--bg); --bs-btn-hover-border-color: var(--border-strong);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--bg); --bs-btn-active-border-color: var(--border-strong);
  --bs-btn-disabled-color: var(--faint); --bs-btn-disabled-bg: var(--surface); --bs-btn-disabled-border-color: var(--border);
  --bs-btn-focus-shadow-rgb: var(--accent-rgb);
}
.btn-outline-primary i, .btn-outline-secondary i { color: var(--slate); }
/* An add/create action wears a green edge, as in ella Hub */
.btn-add { border-left: 3px solid var(--success) !important; }
.btn-success {
  --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success);
  --bs-btn-hover-bg: var(--success-ink); --bs-btn-hover-border-color: var(--success-ink);
  --bs-btn-disabled-bg: var(--success); --bs-btn-disabled-border-color: var(--success);
}
.btn-danger {
  --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger);
  --bs-btn-hover-bg: var(--danger-ink); --bs-btn-hover-border-color: var(--danger-ink);
}
.btn-outline-danger {
  --bs-btn-color: var(--danger-ink); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--danger); --bs-btn-hover-border-color: var(--danger);
}
.btn-outline-success {
  --bs-btn-color: var(--success-ink); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--success); --bs-btn-hover-border-color: var(--success);
}
.btn-outline-warning, .btn-warning {
  --bs-btn-color: var(--warning-ink); --bs-btn-bg: var(--warning-bg); --bs-btn-border-color: #FBD38D;
  --bs-btn-hover-color: var(--warning-ink); --bs-btn-hover-bg: #FDE68A; --bs-btn-hover-border-color: #F6C453;
}
.btn-outline-info, .btn-info {
  --bs-btn-color: var(--info-ink); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border);
  --bs-btn-hover-color: var(--info-ink); --bs-btn-hover-bg: var(--info-bg); --bs-btn-hover-border-color: var(--info-bg);
}
.btn-link { --bs-btn-color: var(--accent); --bs-btn-hover-color: var(--accent-strong); }
.btn:disabled, .btn.disabled { opacity: .55; }

/* Split row action: "View  ▾" as one control */
.btn-group > .btn + .dropdown-toggle-split { padding-left: 9px; padding-right: 9px; }
.btn-group > .btn-outline-primary + .btn-outline-primary { border-left-color: var(--border); }
.btn-group .dropdown-toggle-split::after { margin-left: 0; }
.action-combo .btn-main { min-width: 0; }

/* Segmented controls (btn-check chips) */
.btn-check + .btn-outline-primary { --bs-btn-active-bg: var(--accent-tint); --bs-btn-active-color: var(--accent-strong); --bs-btn-active-border-color: var(--accent); }
.btn-check:checked + .btn-outline-primary { background: var(--accent-tint); color: var(--accent-strong); border-color: var(--accent); }
.btn-check:checked + .btn-outline-primary i { color: var(--accent-strong); }
label.card.btn { align-items: stretch; justify-content: flex-start; }

/* ---- Tables -------------------------------------------------------------- */

.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border);
  --bs-table-hover-bg: #FAFAFC;
  --bs-table-striped-bg: #FAFAFC;
  margin-bottom: 0;
  vertical-align: middle;
}
.table > :not(caption) > * > * { padding: 14px 12px; border-bottom-color: var(--border); }
.table-sm > :not(caption) > * > * { padding: 9px 10px; }
.table thead th, table.dataTable thead th {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--slate-light); background: var(--surface);
  border-bottom: 1px solid var(--border) !important; white-space: nowrap;
}
.table > :not(caption) > * > *:first-child { padding-left: 20px; }
.table > :not(caption) > * > *:last-child { padding-right: 20px; }
.card > .table, .card > .table-responsive > .table { margin-bottom: 0; }
.card > .table tbody tr:last-child td, .card > .table-responsive > .table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover > * { background: #FAFAFC; }
tr[data-href] { cursor: pointer; }
th.text-end, td.text-end { text-align: right; }
.num { font-variant-numeric: tabular-nums; }

/* DataTables 2, in the console's furniture:
   [ 10 per page ] [ Filters ] [ Columns ]                    [ Search… ]   */
.dt-container > .row { margin: 0; --bs-gutter-x: 0; }
.dt-container > .row > [class*="col"] { padding: 0; }
.dt-container > .row:first-child { padding: 14px 20px 10px; align-items: center; row-gap: 10px; }
.dt-container > .row:last-child { padding: 12px 20px 16px; align-items: center; border-top: 1px solid var(--border); row-gap: 10px; }
.dt-container .dt-length { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dt-container .dt-length label { font-size: 14px; color: var(--slate-light); margin: 0; }
.dt-container .dt-length select { width: auto; min-width: 72px; height: 36px; padding-top: 6px; padding-bottom: 6px; margin-right: 6px; }
.dt-container .dt-search { display: flex; justify-content: flex-end; }
.dt-container .dt-search label { display: none; }
.dt-container .dt-search input { height: 38px; min-width: 240px; margin-left: 0 !important; }
.dt-container .dt-info { font-size: 14px; color: var(--slate-light); padding-top: 0 !important; }
.dt-container .dt-paging { display: flex; justify-content: flex-end; }
.dt-container .pagination { gap: 6px; margin: 0 !important; }
.dt-container .page-link {
  min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important;
  color: var(--ink); font-size: 14px; font-weight: 500; background: var(--surface);
}
.dt-container .page-item.active .page-link { background: var(--accent); border-color: var(--accent) !important; color: #fff; }
.dt-container .page-item.disabled .page-link { color: var(--faint); }
table.dataTable { margin: 0 !important; border-collapse: collapse !important; }
table.dataTable thead > tr > th.dt-orderable-asc .dt-column-order,
table.dataTable thead > tr > th.dt-orderable-desc .dt-column-order { opacity: .45; }
table.dataTable thead > tr > th.dt-ordering-asc .dt-column-order::before,
table.dataTable thead > tr > th.dt-ordering-desc .dt-column-order::after { color: var(--accent); opacity: 1; }
/* DataTables 2 right-aligns numeric columns' headers and cells; ours read left */
table.dataTable th.dt-type-numeric, table.dataTable td.dt-type-numeric,
table.dataTable th.dt-type-date, table.dataTable td.dt-type-date { text-align: left; }
table.dataTable th.dt-type-numeric div.dt-column-header, table.dataTable th.dt-type-date div.dt-column-header { flex-direction: row; }

/* Filters / Columns popups (app-tables.js) */
.dt-pop { display: inline-flex; align-items: center; }
.dt-pop details { position: relative; }
.dt-pop summary {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; list-style: none;
  height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.dt-pop summary::-webkit-details-marker { display: none; }
.dt-pop summary i { color: var(--slate-light); font-size: 13px; }
.dt-pop summary:hover { border-color: var(--border-strong); }
.dt-pop summary.is-on { border-color: var(--accent); color: var(--accent); }
.dt-pop summary.is-on i { color: var(--accent); }
.dt-pop-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
}
.dt-pop-panel {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto; text-align: left;
}
.dt-pop details:not([open]) > .dt-pop-panel { display: none; }
.dt-pop-reset {
  margin-top: 6px; border: 0; border-top: 1px solid var(--border); background: none; text-align: left;
  font-size: 13px; color: var(--slate); padding: 9px 8px 4px; cursor: pointer;
}
.dt-pop-reset:hover { color: var(--accent); }
.dt-filterbox-panel { min-width: 240px; gap: 12px; padding: 12px; }
.dt-filter-row { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.dt-filter-row[hidden] { display: none; }
.dt-filter-name { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-light); }
.dt-filter-row select.is-on { border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.dt-cols-panel label {
  display: flex; align-items: center; gap: 9px; margin: 0; padding: 7px 8px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.dt-cols-panel label:hover { background: var(--bg); }
.dt-cols-panel label.is-locked { cursor: default; color: var(--slate-light); }
.dt-cols-panel input { accent-color: var(--accent); width: 15px; height: 15px; flex: none; }

/* A DataTable inside a card body sits flush with the card: the wrapper's
   rows carry their own padding, so the body gives up its own. */
/* Only when the table is ALL the body holds: a card with a details table
   followed by text (mockup and idea pages) keeps its padding. */
.card-body:has(> .dt-container:only-child), .card-body:has(> .table-responsive:only-child > .dt-container),
.card-body:has(> .table-responsive:only-child > .table), .card-body:has(> .table:only-child) { padding: 0; }

/* The actions column on a detail page follows you down the page instead of
   scrolling away under the top bar. */
@media (min-width: 768px) {
  .side-sticky { position: sticky; top: calc(var(--topbar-h) + 16px); align-self: flex-start; }
}
table.dataTable { width: 100% !important; }

/* ---- Status, badges, chips --------------------------------------------- */

.badge { font-weight: 600; font-size: 12px; padding: 4px 9px; border-radius: var(--radius-pill); letter-spacing: 0; }
.badge.bg-secondary { background: #EEF0F4 !important; color: var(--slate) !important; }
.badge.bg-light { background: #F3F4F6 !important; color: var(--slate) !important; border-color: var(--border) !important; }
.badge.bg-success { background: var(--success-bg) !important; color: var(--success-ink) !important; }
.badge.bg-danger { background: var(--danger-bg) !important; color: var(--danger-ink) !important; }
.badge.bg-warning { background: var(--warning-bg) !important; color: var(--warning-ink) !important; }
.badge.bg-info { background: var(--info-bg) !important; color: var(--info-ink) !important; }
.badge.bg-primary { background: var(--accent-tint) !important; color: var(--accent-strong) !important; }
.badge-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: #EEF0F4; color: var(--slate);
}
.status-pending_review { background: var(--warning-bg); color: var(--warning-ink); }
.status-approved_for_mockup, .status-approved_for_product, .status-approved_for_publish { background: var(--info-bg); color: var(--info-ink); }
.status-published { background: var(--success-bg); color: var(--success-ink); }
.status-rejected, .status-sent_back_to_ideas { background: var(--danger-bg); color: var(--danger-ink); }

/* ---- Alerts --------------------------------------------------------------- */

.alert { border: 1px solid transparent; border-radius: var(--radius); padding: 12px 16px; font-size: 14px; }
.alert i { margin-right: 6px; }
.alert-success { background: var(--success-bg); border-color: #BBF7D0; color: var(--success-ink); }
.alert-danger { background: var(--danger-bg); border-color: #FECDD3; color: var(--danger-ink); }
.alert-warning { background: var(--warning-bg); border-color: #FDE68A; color: var(--warning-ink); }
.alert-info { background: #EFF6FF; border-color: #DBEAFE; color: var(--info-ink); }
.alert-light { background: var(--surface); border-color: var(--border); color: var(--ink); }
.alert .alert-link { color: inherit; text-decoration: underline; }
.text-warning { color: var(--warning-ink) !important; }
.text-success { color: var(--success-ink) !important; }
.text-danger { color: var(--danger-ink) !important; }
.text-info { color: var(--info-ink) !important; }
.text-primary { color: var(--accent) !important; }

/* ---- Forms ---------------------------------------------------------------- */

.form-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.form-control, .form-select {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: 15px; padding: 9px 12px; background-color: var(--surface); color: var(--ink);
  box-shadow: none;
}
.form-control-sm, .form-select-sm { font-size: 13px; padding: 6px 10px; }
.form-control-lg { font-size: 16px; padding: 11px 14px; }
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.form-select { background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%238A90A6' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m1 1.75 5 4.5 5-4.5'/%3e%3c/svg%3e"); background-size: 12px 8px; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); border-color: var(--accent); }
.input-group-text { background: var(--bg); border-color: var(--border-strong); color: var(--slate); font-weight: 600; }
.form-text, .form-label small { color: var(--slate-light); }

/* ---- Tabs ----------------------------------------------------------------- */

.nav-tabs { border-bottom: 1px solid var(--border); gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs .nav-link {
  border: 0; border-bottom: 3px solid transparent; border-radius: 0; margin-bottom: -1px;
  padding: 11px 14px; color: var(--slate-light); font-weight: 600; font-size: 15px; white-space: nowrap; background: none;
}
.nav-tabs .nav-link:hover { color: var(--ink); border-bottom-color: var(--border-strong); }
.nav-tabs .nav-link.active, .nav-tabs .nav-link.active:hover { color: var(--accent); border-bottom-color: var(--accent); background: none; }
.nav-pills .nav-link.active { background: var(--accent); }

/* ---- Dropdowns, modals, breadcrumbs ------------------------------------- */

.dropdown-menu {
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-border-radius: var(--radius);
  --bs-dropdown-link-active-bg: var(--accent-tint);
  --bs-dropdown-link-active-color: var(--accent-strong);
  box-shadow: var(--shadow); padding: 6px; font-size: 14px;
}
.dropdown-item { border-radius: var(--radius-sm); padding: 8px 10px; display: flex; align-items: center; gap: 8px; }
.dropdown-item i { width: 16px; text-align: center; color: var(--slate-light); }
.dropdown-header { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.modal { --bs-modal-border-width: 0; --bs-modal-border-radius: var(--radius); --bs-modal-box-shadow: var(--shadow-lg); --bs-modal-header-border-color: var(--border); --bs-modal-footer-border-color: var(--border); }
.modal-title { font-size: 18px; font-weight: 700; }
.breadcrumb { --bs-breadcrumb-divider-color: var(--faint); font-size: 14px; margin: 0; }
.breadcrumb-item a { color: var(--slate-light); }
.breadcrumb-item.active { color: var(--ink); }
.progress { background: #EEF0F4; border-radius: var(--radius-pill); }
.progress-bar { background: var(--accent); }
.spinner-border.text-primary { color: var(--accent) !important; }

/* ---- Pipeline stepper (ideas -> mockups -> products -> published) --------
   A slim step bar: done steps read as ticked links, the current step is the
   accent, later steps are muted. */

.pipeline-container {
  display: flex; margin-bottom: 18px;
}
.pipeline-track {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 5px;
}
.pipeline-stage { display: inline-flex; align-items: center; gap: 0; }
.pipeline-stage .pipeline-node { display: none; }
.pipeline-label, .pipeline-label-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; color: var(--slate-light); text-decoration: none;
}
.pipeline-label-link .pipeline-label { padding: 0; height: auto; }
.pipeline-stage.completed .pipeline-label { color: var(--success-ink); }
.pipeline-stage.completed .pipeline-label::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 11px; }
.pipeline-stage.completed .pipeline-label-link:hover { background: var(--bg); }
.pipeline-stage.current .pipeline-label, .pipeline-stage.current .pipeline-label-link { background: var(--accent); color: #fff; }
.pipeline-stage.future .pipeline-label { color: var(--faint); }
.pipeline-connector { width: 14px; height: 1px; background: var(--border-strong); }
.pipeline-connector.completed { background: var(--success); }

/* ---- Utilities ------------------------------------------------------------ */

.surface { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.muted { color: var(--slate-light); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-light); }
img { max-width: 100%; }
.table-responsive { -webkit-overflow-scrolling: touch; }

/* Google Translate leaves a fixed bar; keep it out of the way */
#google_translate_element { display: none; }
.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }

/* Never scroll sideways on a phone */
@media (max-width: 767.98px) {
  .dt-container .dt-search input { min-width: 0; width: 100%; }
  .dt-container .dt-search { justify-content: stretch; }
  .dt-container .dt-paging, .dt-container .dt-info { justify-content: center; text-align: center; }
  .dt-pop-panel { max-width: calc(100vw - 16px); }
  .page-actions, .page-head { width: 100%; }
  .card-body { overflow-wrap: break-word; }
  .card-header.d-flex { flex-wrap: wrap; gap: 8px; }
  .card-header.d-flex > * { min-width: 0; }
}

/* ==========================================================================
   Sign-in pages: the dark treatment (black page, the brand's mint glow), a
   white card, the same accent button as the app.
   ========================================================================== */

body.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(67, 255, 187, .10), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(var(--accent-rgb), .30), transparent 60%),
    #000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-page .login-container { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-page .login-card {
  background: var(--surface); border: 0; border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45); overflow: hidden;
}
.auth-page .login-header {
  background: none; color: var(--ink); text-align: left;
  padding: 32px 32px 4px; border: 0; position: static;
}
.auth-page .login-header::before {
  content: ''; display: block; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 11px;
  background: url('../logo-mark.svg') center / cover no-repeat;
}
.auth-page .login-header::after { display: none; }
.auth-page .login-header h1, .auth-page .login-header .h3 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0; }
.auth-page .login-header p { color: var(--slate-light); font-size: 14px; margin-top: 4px !important; }
.auth-page .login-body { padding: 24px 32px 32px; background: none; }
.auth-page .btn-login, .auth-page .login-body .btn-primary { width: 100%; --bs-btn-padding-y: 11px; }
.auth-page .auth-links { text-align: center; margin-top: 18px; font-size: 14px; }
.auth-page .auth-links a { color: var(--accent); }
.auth-page .form-control-lg { font-size: 15px; padding: 10px 12px; }

/* ---------------------------------------------------------------------------
   Dashboard
   ------------------------------------------------------------------------ */
.dash-plan { display: inline-flex; align-items: center; gap: 12px; padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); font-size: 13px; color: var(--slate-light); text-decoration: none; white-space: nowrap; }
.dash-plan strong { color: var(--ink); }
.dash-plan:hover { border-color: var(--border-strong); color: var(--slate); }

.dash-steps { list-style: none; margin: 0; padding: 0; }
.dash-step { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--border); }
.dash-step:first-child { border-top: 0; }
.dash-step-icon { flex: 0 0 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); font-size: 15px; }
.dash-step.tone-danger .dash-step-icon { background: var(--danger-bg); color: var(--danger-ink); }
.dash-step.tone-warning .dash-step-icon { background: var(--warning-bg); color: var(--warning-ink); }
.dash-step.tone-neutral .dash-step-icon { background: var(--bg); color: var(--slate-light); }
.dash-step-text { flex: 1 1 auto; min-width: 0; }
.dash-step-text strong { display: block; font-size: 14px; color: var(--ink); }
.dash-step-text span { display: block; font-size: 13px; color: var(--slate-light); }
.dash-step .btn { flex: 0 0 auto; white-space: nowrap; }

.dash-empty { text-align: center; padding: 36px 20px; color: var(--slate-light); }
.dash-empty > i { font-size: 26px; color: var(--faint); margin-bottom: 10px; display: block; }

.dash-windows { position: relative; padding-top: 18px; }
.dash-win-axis { position: absolute; inset: 0 0 auto 42%; height: 16px; }
.dash-win-axis span { position: absolute; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--slate-light); }
.dash-win { display: grid; grid-template-columns: 42% 1fr; align-items: center; gap: 0; padding: 7px 0; text-decoration: none; color: inherit; border-radius: var(--radius-sm); }
.dash-win:hover { background: var(--bg); }
.dash-win-label { min-width: 0; padding-right: 12px; }
.dash-win-label strong { display: block; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-win-label span { display: block; font-size: 12px; color: var(--slate-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-win-track { position: relative; height: 22px; background: linear-gradient(var(--border), var(--border)) center / 100% 1px no-repeat; }
.dash-win-bar { position: absolute; top: 5px; height: 12px; border-radius: 4px; background: var(--faint); }
.dash-win-bar.is-open { background: var(--accent); }
.dash-win-day { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
.dash-win-today { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 1px dashed var(--ink); }
.dash-win-key { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--slate-light); }
.dash-win-key i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.dash-win-key .key-open { background: var(--accent); }
.dash-win-key .key-soon { background: var(--faint); }
.dash-win-key .key-day { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); vertical-align: -1px; }

.dash-delta { font-weight: 600; margin-right: 2px; }
.dash-delta.is-up { color: var(--success-ink); }
.dash-delta.is-down { color: var(--danger-ink); }
.dash-delta.is-flat { color: var(--slate-light); }

.dash-chart { position: relative; height: 240px; }
.dash-data { margin-top: 10px; font-size: 13px; }
.dash-data summary { cursor: pointer; color: var(--slate-light); }
.dash-data table { margin-top: 8px; }

.dash-pipe { display: flex; flex-direction: column; gap: 6px; }
.dash-pipe-row { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 10px; padding: 6px 0; text-decoration: none; color: inherit; border-radius: var(--radius-sm); }
.dash-pipe-row:hover .dash-pipe-bar { background: var(--accent-strong); }
.dash-pipe-label { font-size: 13px; color: var(--slate); }
.dash-pipe-track { height: 20px; display: flex; align-items: center; }
.dash-pipe-bar { display: block; height: 20px; border-radius: 0 4px 4px 0; background: var(--accent); }
.dash-pipe-value { text-align: right; font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

@media (max-width: 575.98px) {
  .dash-step { display: grid; grid-template-columns: 36px 1fr; gap: 8px 14px; padding: 14px 16px; }
  .dash-step .btn { grid-column: 2; justify-self: start; }
  .dash-plan { justify-content: center; gap: 8px; font-size: 12px; }
  .dash-win { grid-template-columns: 1fr; }
  .dash-windows { padding-top: 0; }
  .dash-win-axis { display: none; }
  .dash-chart { height: 200px; }
}
