/*
  BroyApps R6 — Neutral Black Dark Mode
  Scope: dark-mode presentation only. Light mode and application behavior are unchanged.
  Brand: BroyApps Pink #FF7780 + Promo Yellow #FFD12A
*/

html[data-theme="dark"]{
  --broy-dark-canvas:#0B0B0D;
  --broy-dark-sidebar:#0F0F12;
  --broy-dark-surface:#141416;
  --broy-dark-raised:#1B1B1F;
  --broy-dark-soft:#232329;
  --broy-dark-line:#34343B;
  --broy-dark-line-strong:#474750;
  --broy-dark-text:#F7F5F6;
  --broy-dark-secondary:#D4D0D1;
  --broy-dark-muted:#979196;

  --bg:var(--broy-dark-canvas)!important;
  --bg-soft:var(--broy-dark-raised)!important;
  --panel:var(--broy-dark-surface)!important;
  --panel-2:var(--broy-dark-raised)!important;
  --panel2:var(--broy-dark-raised)!important;
  --text:var(--broy-dark-text)!important;
  --muted:var(--broy-dark-muted)!important;
  --line:var(--broy-dark-line)!important;
  --sidebar:var(--broy-dark-sidebar)!important;
  --card:var(--broy-dark-surface)!important;
  --soft:var(--broy-dark-raised)!important;
  --calc-bg:var(--broy-dark-canvas)!important;
  --calc-card:var(--broy-dark-surface)!important;
  --calc-card2:var(--broy-dark-raised)!important;
  --calc-line:var(--broy-dark-line)!important;
  --calc-text:var(--broy-dark-text)!important;
  --calc-muted:var(--broy-dark-muted)!important;
  color-scheme:dark;
  background:var(--broy-dark-canvas)!important;
}

html[data-theme="dark"] body{
  background:
    radial-gradient(circle at 4% 2%,rgba(255,119,128,.085),transparent 26%),
    radial-gradient(circle at 97% 4%,rgba(255,209,42,.035),transparent 20%),
    var(--broy-dark-canvas)!important;
  color:var(--broy-dark-text)!important;
}

/* Shell / navigation */
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .calc-side{
  background:var(--broy-dark-sidebar)!important;
  color:var(--broy-dark-text)!important;
  border-color:var(--broy-dark-line)!important;
}
html[data-theme="dark"] .sidebar-foot{border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] .nav-feature-group{
  background:#161619!important;
  border-color:#3A3A41!important;
  box-shadow:3px 3px 0 rgba(255,209,42,.08)!important;
}
html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .nav-subitem,
html[data-theme="dark"] .calc-nav{color:var(--broy-dark-secondary)!important}
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .nav-subitem:hover,
html[data-theme="dark"] .calc-nav:hover{
  background:#202024!important;
  color:var(--broy-dark-text)!important;
  border-color:#3F3F47!important;
}
html[data-theme="dark"] .nav-item.active,
html[data-theme="dark"] .calc-nav.active{
  background:var(--broy-pink)!important;
  color:var(--broy-ink)!important;
  border-color:var(--broy-pink)!important;
  box-shadow:3px 3px 0 rgba(255,209,42,.78)!important;
}
html[data-theme="dark"] .nav-item.active .nav-icon{background:#FFF2F3!important;color:var(--broy-ink)!important}

/* Generic surfaces */
html[data-theme="dark"] .panel,
html[data-theme="dark"] .account-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .mini-card,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .sales-analytics-shell,
html[data-theme="dark"] .sales-overview-pane,
html[data-theme="dark"] .daily-command-card,
html[data-theme="dark"] .storefront-settings-card,
html[data-theme="dark"] .order-queue-card,
html[data-theme="dark"] .outlet-authority-card,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .promo-group,
html[data-theme="dark"] .auto-voucher-box,
html[data-theme="dark"] .receipt-import,
html[data-theme="dark"] .advanced-manager,
html[data-theme="dark"] .calc-card,
html[data-theme="dark"] .order-card,
html[data-theme="dark"] .official-card,
html[data-theme="dark"] .official-summary article,
html[data-theme="dark"] .catalog-panel,
html[data-theme="dark"] .catalog-card,
html[data-theme="dark"] .drawer-card,
html[data-theme="dark"] .wifi-control,
html[data-theme="dark"] .order-queue-pane,
html[data-theme="dark"] .order-detail,
html[data-theme="dark"] .editor-card,
html[data-theme="dark"] .quick-tool-overlay,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .calc-modal{
  background:var(--broy-dark-surface)!important;
  color:var(--broy-dark-text)!important;
  border-color:var(--broy-dark-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .mini-card:nth-child(odd),
html[data-theme="dark"] .mini-card:nth-child(even){background:var(--broy-dark-surface)!important}

/* Typography */
html[data-theme="dark"] .brand-area b,
html[data-theme="dark"] .calc-brand b,
html[data-theme="dark"] .kopken-brand b,
html[data-theme="dark"] .page-heading h1,
html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .topbar h2,
html[data-theme="dark"] .panel-head h2,
html[data-theme="dark"] .panel-head h3,
html[data-theme="dark"] .card-head h2,
html[data-theme="dark"] .calc-top h1,
html[data-theme="dark"] .summary-card strong,
html[data-theme="dark"] .stat-card .value,
html[data-theme="dark"] .mini-card b,
html[data-theme="dark"] .account-card h3{color:var(--broy-dark-text)!important}
html[data-theme="dark"] .brand-area span,
html[data-theme="dark"] .calc-brand small,
html[data-theme="dark"] .role-label,
html[data-theme="dark"] .topbar p,
html[data-theme="dark"] .panel-head p,
html[data-theme="dark"] .card-head p,
html[data-theme="dark"] .subtext,
html[data-theme="dark"] .stat-card .label,
html[data-theme="dark"] .stat-card .detail,
html[data-theme="dark"] .mini-card span{color:var(--broy-dark-muted)!important}

/* Dashboard hero stays branded and high-contrast. */
html[data-theme="dark"] .dashboard-welcome{
  background:var(--broy-pink)!important;
  color:var(--broy-ink)!important;
  border-color:#080809!important;
}
html[data-theme="dark"] .dashboard-welcome h2{color:var(--broy-ink)!important}
html[data-theme="dark"] .dashboard-welcome p,
html[data-theme="dark"] .dashboard-welcome .section-kicker{color:rgba(43,34,36,.76)!important}
html[data-theme="dark"] .dashboard-live-status{background:#F8F6F7!important;color:var(--broy-ink)!important}

/* Calendar / analytics */
html[data-theme="dark"] .sales-calendar-pane{background:#111113!important}
html[data-theme="dark"] .sales-overview-pane{background:var(--broy-dark-surface)!important}
html[data-theme="dark"] .sales-calendar-weekdays{color:var(--broy-dark-muted)!important}
html[data-theme="dark"] .sales-calendar-day{color:var(--broy-dark-text)!important;background:transparent!important}
html[data-theme="dark"] .sales-calendar-day small{color:#C6BFC1!important}
html[data-theme="dark"] .sales-calendar-day.activity-1{background:rgba(255,119,128,.09)!important}
html[data-theme="dark"] .sales-calendar-day.activity-2{background:rgba(255,119,128,.17)!important}
html[data-theme="dark"] .sales-calendar-day.activity-3{background:rgba(255,209,42,.09)!important}
html[data-theme="dark"] .sales-calendar-day.activity-4{background:rgba(255,209,42,.18)!important}
html[data-theme="dark"] .sales-calendar-day:hover{background:#222226!important;border-color:var(--broy-pink)!important}
html[data-theme="dark"] .sales-calendar-day.selected{background:var(--broy-pink)!important;color:var(--broy-ink)!important;border-color:#080809!important;box-shadow:3px 3px 0 var(--broy-yellow)!important}
html[data-theme="dark"] .sales-calendar-day.selected small{color:var(--broy-ink)!important}
html[data-theme="dark"] .sales-month-switcher,
html[data-theme="dark"] .segmented,
html[data-theme="dark"] .tabs,
html[data-theme="dark"] .primary-tabs{background:#111113!important;border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] .sales-overview-metric,
html[data-theme="dark"] .sales-summary-ring{background:var(--broy-dark-raised)!important;border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] .sales-chart-grid line{stroke:#34343A!important}
html[data-theme="dark"] .sales-chart-labels text{fill:var(--broy-dark-muted)!important}

/* Tables: neutral black hierarchy instead of brown rows. */
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .menu-table-wrap,
html[data-theme="dark"] .official-table-wrap{background:var(--broy-dark-surface)!important;border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] table,
html[data-theme="dark"] .table-wrap table,
html[data-theme="dark"] .menu-table-wrap table,
html[data-theme="dark"] .official-table{background:var(--broy-dark-surface)!important;color:var(--broy-dark-text)!important}
html[data-theme="dark"] th,
html[data-theme="dark"] .table-wrap th,
html[data-theme="dark"] .menu-table-wrap th,
html[data-theme="dark"] .official-table th{
  background:#0F0F11!important;
  color:#E7E2E4!important;
  border-color:var(--broy-dark-line)!important;
}
html[data-theme="dark"] td,
html[data-theme="dark"] .table-wrap td,
html[data-theme="dark"] .menu-table-wrap td,
html[data-theme="dark"] .official-table td{
  background:var(--broy-dark-surface)!important;
  color:var(--broy-dark-text)!important;
  border-color:#2E2E34!important;
}
html[data-theme="dark"] tbody tr:nth-child(even) td{background:#17171A!important}
html[data-theme="dark"] tbody tr:hover td,
html[data-theme="dark"] .table-wrap tbody tr:hover td{background:#202024!important}
html[data-theme="dark"] .account-row-inactive td{background:#101012!important;color:var(--broy-dark-muted)!important}
html[data-theme="dark"] .account-row-available td{background:rgba(255,119,128,.065)!important}
html[data-theme="dark"] .account-row-full td{background:rgba(255,209,42,.055)!important}

/* Forms / utilities */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .search,
html[data-theme="dark"] .filters input,
html[data-theme="dark"] .filters select,
html[data-theme="dark"] .money-field,
html[data-theme="dark"] .tier-select,
html[data-theme="dark"] .editor-field>input,
html[data-theme="dark"] .editor-field>select,
html[data-theme="dark"] .editor-field textarea,
html[data-theme="dark"] .order-queue-filters input,
html[data-theme="dark"] .order-queue-filters select{
  background:var(--broy-dark-raised)!important;
  color:var(--broy-dark-text)!important;
  border-color:var(--broy-dark-line)!important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#858086!important}
html[data-theme="dark"] .money-field>span{background:#101012!important;color:var(--broy-dark-secondary)!important;border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .btn.ghost,
html[data-theme="dark"] .soft-btn,
html[data-theme="dark"] .icon-action,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .period-box,
html[data-theme="dark"] .page-button,
html[data-theme="dark"] .pager button{
  background:var(--broy-dark-raised)!important;
  color:var(--broy-dark-text)!important;
  border-color:var(--broy-dark-line)!important;
}
html[data-theme="dark"] .modal-head,
html[data-theme="dark"] .modal-foot,
html[data-theme="dark"] .editor-head{background:var(--broy-dark-surface)!important;border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] .close-button,
html[data-theme="dark"] .editor-close{background:var(--broy-dark-raised)!important;color:var(--broy-dark-text)!important;border-color:var(--broy-dark-line)!important}

/* Calculator / menus */
html[data-theme="dark"] .order-empty{background:#111113!important;color:var(--broy-dark-muted)!important;border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] .menu-results{background:var(--broy-dark-raised)!important;border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] .menu-results button:hover{background:#242429!important}
html[data-theme="dark"] .account-action-list>button{background:var(--broy-dark-raised)!important;color:var(--broy-dark-text)!important;border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] .account-action-list>button:hover{background:#242429!important;border-color:var(--broy-pink)!important}

/* Login: visibly darker and neutral-black, not chocolate/wine. */
html[data-theme="dark"] .login-screen{
  background:
    radial-gradient(circle at 12% 15%,rgba(255,119,128,.095),transparent 28%),
    radial-gradient(circle at 88% 82%,rgba(255,209,42,.035),transparent 23%),
    var(--broy-dark-canvas)!important;
}
html[data-theme="dark"] .login-shell{
  background:var(--broy-dark-surface)!important;
  border-color:var(--broy-dark-line-strong)!important;
  box-shadow:9px 9px 0 rgba(255,209,42,.68)!important;
}
html[data-theme="dark"] .login-showcase{background:#101012!important;color:var(--broy-dark-text)!important}
html[data-theme="dark"] .login-feature{background:#18181B!important;border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] .login-feature:nth-child(2){background:rgba(255,209,42,.07)!important}
html[data-theme="dark"] .login-card{background:var(--broy-dark-surface)!important;color:var(--broy-dark-text)!important}
html[data-theme="dark"] .login-field input{background:var(--broy-dark-raised)!important;color:var(--broy-dark-text)!important;border-color:var(--broy-dark-line)!important}
html[data-theme="dark"] .login-theme-toggle{background:var(--broy-dark-raised)!important;color:var(--broy-dark-text)!important;border-color:var(--broy-dark-line)!important}

/* Overlays / loading */
html[data-theme="dark"] .modal-backdrop,
html[data-theme="dark"] .calc-modal-bg{background:rgba(0,0,0,.72)!important}
html[data-theme="dark"] .loader{background:rgba(0,0,0,.82)!important}
html[data-theme="dark"] .loader div{box-shadow:0 0 0 7px rgba(10,10,12,.94),4px 4px 0 7px rgba(255,209,42,.20)!important}

/* Mobile */
@media(max-width:760px){
  html[data-theme="dark"] .mobile-bottom-nav{background:#0F0F12!important;border-color:var(--broy-dark-line)!important}
}

/* Profile/account cards that had direct warm-brown overrides in R5. */
html[data-theme="dark"] .profile-slot,
html[data-theme="dark"] .profile-buyer-row{
  background:var(--broy-dark-raised)!important;
  border-color:var(--broy-dark-line)!important;
  color:var(--broy-dark-text)!important;
}
html[data-theme="dark"] .profile-slot.occupied{
  background:rgba(255,119,128,.08)!important;
  border-color:rgba(255,119,128,.42)!important;
}
html[data-theme="dark"] .profile-slot:hover{
  background:#242429!important;
  border-color:var(--broy-pink)!important;
}
