/*
 * Cadmus Custom CSS
 * ══════════════════════════════════════
 * STRICT THEME SEPARATION (Step 4390)
 * ══════════════════════════════════════
 */

/* ════════════════
   1. DARK THEME RULES [data-theme="dark"]
   - Transparent headers
   - Colored text
   - Dark backgrounds
   ════════════════ */

/* Kanban Transparency (DARK ONLY) */
[data-theme="dark"] .kan-ban-col .panel-heading,
[data-theme="dark"] .kan-ban-col .panel-heading .heading,
[data-theme="dark"] .kan-ban-col .panel-heading span,
[data-theme="dark"] .kan-ban-col .panel-heading i,
[data-theme="dark"] .kan-ban-col .panel-heading .fa {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
  color: inherit !important;
  /* Allow inline style color to work */
}

/* Main Backgrounds (DARK ONLY) */
[data-theme="dark"] body,
[data-theme="dark"] #wrapper,
[data-theme="dark"] .content,
[data-theme="dark"] .app {
  background: #0F1621 !important;
  background-color: #0F1621 !important;
  color: #F4F2EC !important;
}

/* Panels & Cards (DARK ONLY) */
[data-theme="dark"] .panel_s,
[data-theme="dark"] .panel,
[data-theme="dark"] .card,
[data-theme="dark"] .panel-body,
[data-theme="dark"] .leads-overview {
  background: #161D14 !important;
  background-color: #161D14 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #F4F2EC !important;
}

/* Tables (DARK ONLY) */
[data-theme="dark"] .table,
[data-theme="dark"] .table-responsive,
[data-theme="dark"] table.dataTable,
[data-theme="dark"] table tbody tr td {
  background: transparent !important;
  background-color: transparent !important;
  color: #F4F2EC !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Force Table Links to be Light (Not Gold) in Dark Mode */
[data-theme="dark"] table a {
  color: #F4F2EC !important;
  text-decoration: none !important;
}

[data-theme="dark"] table a:hover {
  color: #ffffff !important;
  text-decoration: underline !important;
}

/* Card Content (DARK ONLY) */
[data-theme="dark"] .kan-ban-content,
[data-theme="dark"] .kan-ban-content p,
[data-theme="dark"] .kan-ban-content span,
[data-theme="dark"] .kan-ban-content div {
  color: #9ca3af !important;
  /* Light Gray for Dark Mode */
}

/* Form Inputs (DARK ONLY) */
[data-theme="dark"] .form-control,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #0A1018 !important;
  color: #F4F2EC !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* ════════════════
   2. LIGHT THEME RULES (Default or [data-theme="light"])
   - White backgrounds
   - Dark/Black Text
   - Standard Look
   ════════════════ */

/* Force Black Text for Specific Columns (LIGHT ONLY) */
/* The user requested this for "Leads Page", likely in Light Mode context originally */
body:not([data-theme="dark"]) #leads tbody td:nth-child(2),
body:not([data-theme="dark"]) #leads tbody td:nth-child(3),
body:not([data-theme="dark"]) #leads tbody td:nth-child(3) a,
body:not([data-theme="dark"]) #leads tbody td:nth-child(4),
body:not([data-theme="dark"]) #leads tbody td:nth-child(4) a,
body:not([data-theme="dark"]) #leads tbody td:nth-child(8),
body:not([data-theme="dark"]) #leads tbody td:nth-child(8) a {
  color: #000000 !important;
}

/* Ensure White Backgrounds for Light Mode */
body:not([data-theme="dark"]),
body:not([data-theme="dark"]) #wrapper,
body:not([data-theme="dark"]) .content {
  background-color: #f0f2f5 !important;
  /* Standard Light Gray BG */
  color: #333333 !important;
}

body:not([data-theme="dark"]) .panel_s,
body:not([data-theme="dark"]) .panel {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #333333 !important;
}

/* Kanban Headers - Restore White Background in Light Mode */
body:not([data-theme="dark"]) .kan-ban-col .panel-heading {
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
}

/* Kanban Content - Restore Dark Text in Light Mode */
body:not([data-theme="dark"]) .kan-ban-content,
body:not([data-theme="dark"]) .kan-ban-content p {
  color: #4b5563 !important;
}

/* ════════════════
   3. SHARED UTILITIES
   ════════════════ */
/* Gold Links (Any Mode) */
a {
  color: #bfa05a;
}

/* ════════════════
   4. SIDEBAR SCROLLING FIX
   The original Perfex sidebar is position:absolute but lacks overflow-y
   This enables independent sidebar scrolling
   ════════════════ */

.sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Thin, subtle scrollbar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}