/* ============================================================
   CricBata PREMIUM v3.0 — Dark Theme
   Modern Blue Professional
   ============================================================ */

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

:root[data-theme="dark"] {

  /* --- Base Backgrounds --- */
  --bg-root:        #060810;
  --bg-surface:     #0c0f1a;
  --bg-card:        #111526;
  --bg-elevated:    #161b2e;
  --bg-input:       #0e1120;
  --bg-hover:       #1a2035;
  --bg-active:      #1e263e;
  --bg-row-alt:     #0c1228;
  --bg-overlay:     rgba(0, 0, 0, 0.82);

  /* --- Borders --- */
  --border-subtle:  #151c30;
  --border-default: #1c2540;
  --border-strong:  #243050;
  --border-focus:   #2563eb;

  /* --- Brand / Accent --- */
  --accent-primary:   #2563eb;
  --accent-secondary: #1d4ed8;
  --accent-bright:    #3b82f6;
  --accent-glow:      rgba(37, 99, 235, 0.18);
  --accent-glow-lg:   rgba(37, 99, 235, 0.08);

  /* --- Semantic Colors --- */
  --color-positive:       #10b981;
  --color-positive-dim:   #059669;
  --color-positive-bg:    rgba(16, 185, 129, 0.10);
  --color-positive-chip:  rgba(16, 185, 129, 0.15);

  --color-negative:       #f43f5e;
  --color-negative-dim:   #e11d48;
  --color-negative-bg:    rgba(244, 63, 94, 0.10);
  --color-negative-chip:  rgba(244, 63, 94, 0.15);

  --color-gold:           #f59e0b;
  --color-gold-dim:       #d97706;
  --color-gold-bg:        rgba(245, 158, 11, 0.10);
  --color-gold-chip:      rgba(245, 158, 11, 0.15);

  /* K/L Badges */
  --badge-k-bg:    #f43f5e;
  --badge-k-text:  #ffffff;
  --badge-l-bg:    #10b981;
  --badge-l-text:  #ffffff;

  /* --- Typography --- */
  --text-primary:   #e2e8f8;
  --text-secondary: #7b8db8;
  --text-muted:     #485070;
  --text-disabled:  #2d3550;
  --text-inverse:   #060810;

  /* --- Header --- */
  --header-bg:      linear-gradient(135deg, #090d1c 0%, #0c1020 100%);
  --header-border:  #151c35;
  --header-glow:    0 1px 0 rgba(37,99,235,0.15);

  /* --- Table --- */
  --table-header-bg:      #080c18;
  --table-header-text:    #5a6890;
  --table-header-border:  #1a2240;
  --table-header-shadow:  rgba(0,0,0,0.6);
  --table-row-bg:         #0b0e1c;
  --table-row-alt:        #0c1228;
  --table-row-hover:      #161d35;
  --table-total-bg:       #0d1018;
  --table-border:         #131828;
  --table-sticky-shadow:  0 2px 8px rgba(0,0,0,0.7);

  /* --- Inputs --- */
  --input-bg:        #0a0e1c;
  --input-border:    #1a2038;
  --input-focus-bg:  #0d1220;
  --input-text:      #e2e8f8;
  --input-placeholder: #2d3858;

  /* --- Buttons --- */
  --btn-primary-bg:     linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --btn-primary-text:   #ffffff;
  --btn-primary-hover:  linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --btn-primary-shadow: 0 4px 14px rgba(37,99,235,0.35);

  --btn-danger-bg:      linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --btn-danger-text:    #ffffff;
  --btn-danger-hover:   #f43f5e;

  --btn-success-bg:     linear-gradient(135deg, #10b981 0%, #059669 100%);
  --btn-success-text:   #ffffff;
  --btn-success-hover:  #10b981;

  --btn-ghost-bg:       transparent;
  --btn-ghost-text:     #7b8db8;
  --btn-ghost-hover:    #161b2e;
  --btn-ghost-border:   #1c2540;

  /* --- Dialog --- */
  --dialog-bg:      #0e1220;
  --dialog-border:  #1c2540;
  --dialog-shadow:  0 32px 80px rgba(0,0,0,0.9), 0 0 0 1px rgba(37,99,235,0.08);

  /* --- Scrollbar --- */
  --scrollbar-track: #0c0f1a;
  --scrollbar-thumb: #1c2540;
  --scrollbar-hover: #243050;

  /* --- Splash --- */
  --splash-bg:      #060810;
  --splash-glow:    rgba(37, 99, 235, 0.25);

  /* --- PIN Screen --- */
  --pin-dot-empty:  #1a2038;
  --pin-dot-filled: #2563eb;
  --pin-key-bg:     #0e1220;
  --pin-key-hover:  #161b2e;
  --pin-key-border: #1c2540;

  /* --- Nav --- */
  --nav-bg:         #080c18;
  --nav-border:     #131828;
  --nav-item-text:  #3d4d70;
  --nav-item-active-text: #e2e8f8;
  --nav-item-active-bg:   #111830;
  --nav-indicator:  #2563eb;

  /* --- Shadows --- */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.6);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.7);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.8);
  --shadow-blue: 0 4px 20px rgba(37,99,235,0.25);
}


/* THEME CONSISTENCY V1 */
.app-header,
.topbar,
.header,
.navbar,
.bottom-nav,
.tabbar,
.footer-nav{
  background: var(--header-bg) !important;
  color: var(--text-primary) !important;
}

.bottom-nav,
.tabbar,
.footer-nav{
  border-top: 1px solid var(--border-color) !important;
}

.bottom-nav .active,
.tabbar .active{
  color: var(--accent-primary, #2563eb) !important;
}


/* HEADER CLIENT POLISH V1 */

/* Light mode header shell */
html[data-theme="light"] .app-shell,
html[data-theme="light"] .app-header,
html[data-theme="light"] .topbar,
html[data-theme="light"] .header,
html[data-theme="light"] .toolbar,
html[data-theme="light"] .app-toolbar{
    background:#ffffff !important;
    color:#111827 !important;
    border-color:#e5e7eb !important;
}

/* Client selection */
.client-item.active,
.client-item.selected,
.client-row.active,
.client-row.selected,
.client-list-item.active,
.client-list-item.selected{
    border-left:4px solid #2563eb !important;
    background:rgba(37,99,235,.12) !important;
    font-weight:700 !important;
    box-shadow:inset 0 0 0 1px rgba(37,99,235,.15) !important;
}

/* Light mode selected client text */
html[data-theme="light"] .client-item.active,
html[data-theme="light"] .client-item.selected,
html[data-theme="light"] .client-row.active,
html[data-theme="light"] .client-row.selected{
    color:#111827 !important;
}

/* Slightly narrower left panel */
.clients-sidebar,
.clients-panel-left,
.client-list-panel{
    width:22% !important;
    max-width:22% !important;
}


/* PREMIUM THEME REFACTOR V1 */
:root{
  --sheet-bg:#FCFCFD;
  --sheet-text:#111827;
  --sheet-border:#E5EAF2;
}
[data-theme="dark"]{
  --sheet-bg:#0D1B36;
  --sheet-text:#FFFFFF;
  --sheet-border:#1E325C;
}

.dialog,.modal,.sheet,.bottom-sheet,.popup,.confirm-dialog,.subscription-modal{
  background:var(--sheet-bg)!important;
  color:var(--sheet-text)!important;
  border:1px solid var(--sheet-border)!important;
  backdrop-filter:none!important;
  border-radius:24px!important;
}

.dialog *,.modal *,.sheet *,.bottom-sheet *,.popup *,.confirm-dialog *,.subscription-modal *{
  color:inherit!important;
}

.toast{
  background:var(--sheet-bg)!important;
  color:var(--sheet-text)!important;
  border:1px solid var(--sheet-border)!important;
}


/* DATA DENSITY V1 */

/* Client list */
.client-item,
.client-row,
.client-list-item{
  min-height:44px !important;
  padding:8px 12px !important;
}

/* Tables */
table th{
  padding:8px 10px !important;
}
table td{
  padding:7px 10px !important;
}

/* Ledger / reports / saved rows */
.ledger-table td,
.report-table td,
.saved-table td{
  padding-top:6px !important;
  padding-bottom:6px !important;
}

/* Teams / Groups lists */
.team-row,
.group-row,
.list-row{
  min-height:40px !important;
  padding:6px 10px !important;
}

/* Client header visibility */
.client-name,
.client-title{
  font-weight:800 !important;
  color:var(--text-primary,#111827) !important;
}


/* CLIENTS FOCUSED V1 */
.client-name-row{min-height:42px!important;padding:8px 12px!important;font-weight:700!important;}
[data-theme="light"] .client-name-row{color:#111827!important;}
[data-theme="dark"] .client-name-row{color:#F8FAFC!important;}
.client-name-row.active{border-left:4px solid #2563EB!important;font-weight:800!important;}
[data-theme="light"] .client-name-row.active{background:#DCEBFF!important;}
[data-theme="dark"] .client-name-row.active{background:#102044!important;}


/* Clients final polish */
.clients-sidebar,.clients-list-panel{flex-basis:20%!important;width:20%!important;max-width:260px!important;}
.client-form .input-label,.client-details .input-label{
font-size:11px!important;
font-weight:600!important;
letter-spacing:.08em!important;
}
