/* ============================================================
   CricBata v2.0 — Light Theme
   Professional Cricket Ledger
   ============================================================ */

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

  /* --- Base Backgrounds --- */
  --bg-root:        #f0f2f5;
  --bg-surface:     #ffffff;
  --bg-card:        #ffffff;
  --bg-elevated:    #f8f9fb;
  --bg-input:       #f4f6f9;
  --bg-hover:       #eef0f4;
  --bg-active:      #e6e9ef;
  --bg-row-alt:     #edf0f8;
  --bg-overlay:     rgba(0, 0, 0, 0.45);

  /* --- Borders --- */
  --border-subtle:  #e8eaef;
  --border-default: #dde0e8;
  --border-strong:  #c8ccd6;
  --border-focus:   #3d7fff;

  /* --- Brand / Accent --- */
  --accent-primary:   #2563eb;
  --accent-secondary: #1d4ed8;
  --accent-glow:      rgba(37, 99, 235, 0.10);

  /* --- Semantic Colors --- */
  --color-positive:       #16a34a;
  --color-positive-dim:   #15803d;
  --color-positive-bg:    rgba(22, 163, 74, 0.08);
  --color-positive-chip:  rgba(22, 163, 74, 0.12);

  --color-negative:       #dc2626;
  --color-negative-dim:   #b91c1c;
  --color-negative-bg:    rgba(220, 38, 38, 0.08);
  --color-negative-chip:  rgba(220, 38, 38, 0.12);

  --color-gold:           #b45309;
  --color-gold-dim:       #92400e;
  --color-gold-bg:        rgba(180, 83, 9, 0.08);
  --color-gold-chip:      rgba(180, 83, 9, 0.12);

  /* K/L Badges */
  --badge-k-bg:    #dc2626;
  --badge-k-text:  #ffffff;
  --badge-l-bg:    #16a34a;
  --badge-l-text:  #ffffff;

  /* --- Typography --- */
  --text-primary:   #0f1219;
  --text-secondary: #4b5268;
  --text-muted:     #8b92a8;
  --text-disabled:  #c4c8d4;
  --text-inverse:   #ffffff;

  /* --- Header --- */
  --header-bg:      #ffffff;
  --header-border:  #e2e5ed;

  /* --- Table --- */
  --table-header-bg:      #e8ecf3;
  --table-header-text:    #4a5270;
  --table-header-border:  #c8cdd9;
  --table-header-shadow:  rgba(0,0,0,0.08);
  --table-row-bg:         #ffffff;
  --table-row-alt:        #e8edf6;
  --table-row-hover:      #dde3f0;
  --table-total-bg:       #fefce8;
  --table-border:         #dde0ea;
  --table-sticky-shadow:  0 2px 8px rgba(0,0,0,0.08);

  /* --- Inputs --- */
  --input-bg:        #f4f6f9;
  --input-border:    #dde0e8;
  --input-focus-bg:  #ffffff;
  --input-text:      #0f1219;
  --input-placeholder: #a0a8bc;

  /* --- Buttons --- */
  --btn-primary-bg:     #2563eb;
  --btn-primary-text:   #ffffff;
  --btn-primary-hover:  #1d4ed8;

  --btn-danger-bg:      #dc2626;
  --btn-danger-text:    #ffffff;
  --btn-danger-hover:   #b91c1c;

  --btn-success-bg:     #16a34a;
  --btn-success-text:   #ffffff;
  --btn-success-hover:  #15803d;

  --btn-ghost-bg:       transparent;
  --btn-ghost-text:     #4b5268;
  --btn-ghost-hover:    #eef0f4;
  --btn-ghost-border:   #dde0e8;

  /* --- Dialog --- */
  --dialog-bg:      #ffffff;
  --dialog-border:  #dde0e8;
  --dialog-shadow:  0 24px 64px rgba(0,0,0,0.18);

  /* --- Scrollbar --- */
  --scrollbar-track: #f0f2f5;
  --scrollbar-thumb: #c8ccd6;
  --scrollbar-hover: #a0a8bc;

  /* --- Splash --- */
  --splash-bg:      #0a0c0f;
  --splash-glow:    rgba(61, 127, 255, 0.2);

  /* --- PIN Screen --- */
  --pin-dot-empty:  #dde0e8;
  --pin-dot-filled: #2563eb;
  --pin-key-bg:     #f4f6f9;
  --pin-key-hover:  #eef0f4;
  --pin-key-border: #dde0e8;

  /* --- Nav --- */
  --nav-bg:         #ffffff;
  --nav-border:     #e2e5ed;
  --nav-item-text:  #8b92a8;
  --nav-item-active-text: #0f1219;
  --nav-item-active-bg:   #eef1f7;
  --nav-indicator:  #2563eb;

  /* --- Shadows --- */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.16);
}


/* 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;
}
