/* Admin-only WowDash inspired overrides (loaded only in admin-cms/header.php)
   Purpose: increase card sizes, improve typography and add subtle color accents for better scannability.
*/
:root{
  --wd-admin-accent: #0b63c8;
  --wd-wow-primary: #0b63c8; /* deep blue */
  --wd-wow-info: #06b6d4; /* cyan */
  --wd-wow-success: #10b981; /* green */
  --wd-wow-warning: #f59e0b; /* amber */
  --wd-wow-danger: #ef4444; /* red */
  --wd-admin-card-bg: #ffffff;
  --wd-admin-card-border: #eef3f8;
  --wd-admin-muted: #6b7280;
}

/* Card base */
.wd-card{
  background: var(--wd-admin-card-bg);
  border: 1px solid var(--wd-admin-card-border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 10px 26px rgba(11,99,200,0.05);
  transition: transform .12s ease, box-shadow .12s ease;
  min-height: 110px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  width:100%; /* ensure card fills its column */
  /* entrance animation is opt-in: add .wd-card-animated to enable */
}

/* Equalize all cards in the lower row */
.chat-report-row {
  display: flex;
  flex-wrap: wrap;
}
.chat-report-row > div {
  display: flex;
  align-items: stretch;
}
.chat-report-row .wd-card {
  height: 100%;
}
.wd-card:hover{ transform: translateY(-4px); box-shadow:0 10px 28px rgba(11,99,200,0.06); }

/* Card entrance animation: disabled by default for readability; enable by adding .wd-card-animated */
.wd-card-animated { transform-origin: center; opacity:0; transform: translateY(8px); animation: wd-card-in .42s ease forwards; }
@keyframes wd-card-in { to{ opacity:1; transform: translateY(0); } }

/* Modifier colors */
.wd-card--primary { border-color: rgba(11,99,200,0.12); }
.wd-card--info { border-color: rgba(6,182,212,0.12); }
.wd-card--success { border-color: rgba(16,185,129,0.12); }
.wd-card--warning { border-color: rgba(245,158,11,0.12); }
.wd-card--danger { border-color: rgba(239,68,68,0.12); }

.wd-card--primary .wd-card-amount{ color: var(--wd-wow-primary); }
.wd-card--info .wd-card-amount{ color: var(--wd-wow-info); }
.wd-card--success .wd-card-amount{ color: var(--wd-wow-success); }
.wd-card--warning .wd-card-amount{ color: var(--wd-wow-warning); }
.wd-card--danger .wd-card-amount{ color: var(--wd-wow-danger); }

/* Staggered animation utility */
.wd-card[data-wd-index="0"]{ animation-delay: 0s; }
.wd-card[data-wd-index="1"]{ animation-delay: .05s; }
.wd-card[data-wd-index="2"]{ animation-delay: .1s; }
.wd-card[data-wd-index="3"]{ animation-delay: .15s; }
.wd-card[data-wd-index="4"]{ animation-delay: .2s; }
.wd-card[data-wd-index="5"]{ animation-delay: .25s; }
.wd-card[data-wd-index="6"]{ animation-delay: .3s; }
.wd-card[data-wd-index="7"]{ animation-delay: .35s; }
.wd-card[data-wd-index="2"]{ animation-delay: .1s; }
.wd-card[data-wd-index="3"]{ animation-delay: .15s; }
.wd-card[data-wd-index="4"]{ animation-delay: .2s; }
.wd-card[data-wd-index="5"]{ animation-delay: .25s; }

.wd-card-title {
  font-size: 20px; /* updated font size for card titles */
  font-weight: 700;
  color: #071427;
  margin: 6px 0 4px 0;
  letter-spacing: 0.2px;
}

.wd-card-amount{
  font-size: 42px; /* big numbers */
  font-weight: 800;
  color: #0b1720; /* dark for readability */
}

.wd-countup{ font-variant-numeric: tabular-nums; }

/* Small action within card */
.btn-wd{
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor:pointer;
}
.btn-wd.small{ padding:6px 10px; font-size:13px; }
.btn-wd.primary{ background: var(--wd-admin-accent); color: #fff; }
.btn-wd.ghost{ background: transparent; color: var(--wd-admin-accent); border:1px solid rgba(11,99,200,0.08); }

/* Grid helpers (admin dashboard) */
.wd-grid{ display:flex; flex-wrap:wrap; gap:18px; }
.wd-grid .col-lg-2, .wd-grid .col-6, .wd-grid [class*="col-"]{ display:flex; }
.wd-grid .wd-card{ min-height: 92px; flex:1 1 auto; }

/* Equal-height rows: make each row's columns and their wd-card children stretch to same height */
.row.equalize { display:flex; flex-wrap:wrap; }
.row.equalize > [class*="col-"]{ display:flex; align-items:stretch; }
.row.equalize > [class*="col-"] .wd-card{ flex:1 1 auto; display:flex; flex-direction:column; height:100%; }
/* Also equalize standard Bootstrap .card elements when used in admin rows */
.row.equalize > [class*="col-"] .card{ flex:1 1 auto; display:flex; flex-direction:column; height:100%; }
.row.equalize > [class*="col-"] .card .card-body{ flex:1 1 auto; }

/* For two-column equal rows, ensure .col-md-6 occupies 50% width at md and larger */
@media (min-width: 768px) {
  .row.equalize > .col-md-6 { flex: 0 0 50%; max-width: 50%; }
}

/* Six-column helper for admin stat rows */
.wd-six{ display:flex; flex-wrap:nowrap; gap:18px; }
.wd-six > .col-lg-2, .wd-six > .col-6 { flex: 0 0 calc(100% / 6 - 18px); max-width: calc(100% / 6 - 18px); }
@media (max-width:1199px){ .wd-six > .col-lg-2, .wd-six > .col-6 { flex: 0 0 calc(100% / 3 - 12px); max-width: calc(100% / 3 - 12px); } }
@media (max-width:767px){ .wd-six { flex-direction:column; } .wd-six > .col-lg-2, .wd-six > .col-6 { width:100%; max-width:100%; flex: 0 0 100%; } }

/* Accent helpers for colored cards when desirable */
.wd-card-accent{ position: relative; overflow: visible; }
.wd-card-accent:before{ content: ""; position:absolute; right:12px; top:-10px; width:66px; height:66px; border-radius:50%; background: linear-gradient(135deg, rgba(11,99,200,0.12), rgba(11,99,200,0.04)); z-index:0; }
.wd-card *{ position: relative; z-index:1; }

/* Responsive tuning */
@media (max-width:1199px){ .wd-card{ padding:16px 18px; min-height:98px; } .wd-card-amount{ font-size:22px; } }
@media (max-width:767px){ .wd-card{ padding:12px 14px; min-height:86px; } .wd-card-amount{ font-size:18px; } }

/* Tables inside admin widgets */
.admin-widget-table td, .admin-widget-table th{ vertical-align: middle; }

/* Crypto-style tile (Ethereum-like) */
.wd-crypto {
  display:flex; align-items:center; gap:12px; justify-content:space-between; width:100%;
}
.wd-crypto-left{ display:flex; gap:12px; align-items:center; }
.wd-crypto-symbol{ width:44px; height:44px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-weight:800; color:#fff; font-size:14px; }
.wd-crypto-name{ font-size:13px; font-weight:700; color:#fff; opacity:0.95; }
.wd-crypto-ticker{ font-size:12px; color:rgba(255,255,255,0.9); }

.wd-card--crypto{ color:#fff; position:relative; overflow:hidden; }
.wd-card--crypto .wd-card-amount{ color:#fff; text-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.wd-card--crypto .wd-card-title{ color:rgba(255,255,255,0.96); text-shadow: 0 1px 3px rgba(0,0,0,0.32); }
.wd-card--crypto .wd-card-sub{ color: rgba(255,255,255,0.88); }
.wd-card--crypto:after{ content:""; position:absolute; left:-40%; top:-40%; width:60%; height:200%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.06), transparent 20%); transform: rotate(15deg); pointer-events:none; }

/* Buttons / actions within crypto cards */
.wd-card--crypto .btn-wd{ background: rgba(255,255,255,0.08); color: #fff; border:1px solid rgba(255,255,255,0.08); }
.wd-card--crypto .btn-wd.primary{ background: rgba(255,255,255,0.12); color:#fff; border-color: rgba(255,255,255,0.12); }
.wd-card--crypto .btn-wd.ghost{ background: transparent; color: rgba(255,255,255,0.95); border:1px solid rgba(255,255,255,0.12); }

/* crypto symbol adjustments for contrast */
.wd-card--crypto .wd-crypto-symbol{ background: rgba(255,255,255,0.12); color:#fff; box-shadow: 0 6px 18px rgba(11,99,200,0.06); }

/* gradient helper classes (fallbacks) */
.wd-grad-1{ background: linear-gradient(135deg,#6a11cb 0%, #2575fc 100%); }
.wd-grad-2{ background: linear-gradient(135deg,#ff7e5f 0%, #feb47b 100%); }
.wd-grad-3{ background: linear-gradient(135deg,#00c6ff 0%, #0072ff 100%); }
.wd-grad-4{ background: linear-gradient(135deg,#f7971e 0%, #ffd200 100%); }
.wd-grad-5{ background: linear-gradient(135deg,#7f00ff 0%, #e100ff 100%); }
.wd-grad-6{ background: linear-gradient(135deg,#11998e 0%, #38ef7d 100%); }

/* Deterministic index card gradients for modifiers (light, for dark text) */
.wd-card--primary{ background: linear-gradient(135deg,#e8f3ff 0%, #ffffff 100%); }
.wd-card--info{ background: linear-gradient(135deg,#e9fbff 0%, #ffffff 100%); }
.wd-card--success{ background: linear-gradient(135deg,#eefaf2 0%, #ffffff 100%); }
.wd-card--warning{ background: linear-gradient(135deg,#fff8ec 0%, #ffffff 100%); }
.wd-card--danger{ background: linear-gradient(135deg,#fff2f2 0%, #ffffff 100%); }

/* Card header style similar to WowDash */
.card .card-header{ background: linear-gradient(180deg, rgba(11,99,200,0.03), rgba(11,99,200,0.0)); border-bottom:1px solid rgba(11,99,200,0.04); padding:12px 16px; }
.card .card-header .card-title{ font-size:16px; color:#0b1720; font-weight:700; }

/* WowDash-like sidebar styling (light theme) */
.main-sidebar { border-right: 1px solid #eef3f8; }
.main-sidebar .nav-sidebar .nav-link { font-weight:600; border-radius:8px; color:#111827; }
.main-sidebar .nav-sidebar .nav-link:hover{ background: #f3f4f6; color:#111827; }
.main-sidebar .nav-sidebar .nav-link.active{ background: #e8f1ff; color: #0b63c8; box-shadow: inset 0 0 0 1px rgba(11,99,200,0.06); }
.main-sidebar .nav-icon{ color: #6b7280; margin-right:8px; }
/* Hover and selected colors (light theme) */
.main-sidebar .nav-sidebar .nav-link:hover,
.main-sidebar .nav-sidebar .nav-link:focus{
  background-color: #f3f4f6 !important;
  color: #111827 !important;
}
.main-sidebar .nav-sidebar .nav-link.active,
.main-sidebar .nav-sidebar .nav-item.menu-open > a.nav-link{
  background-color: #e8f1ff !important;
  color: #0b63c8 !important;
}
/* Make icons accent on active/hover */
.main-sidebar .nav-sidebar .nav-link:hover .nav-icon,
.main-sidebar .nav-sidebar .nav-link.active .nav-icon,
.main-sidebar .nav-sidebar .nav-item.menu-open > a.nav-link .nav-icon{
  color: #0b63c8 !important;
}
/* Treeview submenu links when hovered/active should match */
.main-sidebar .nav-sidebar .nav-treeview .nav-link:hover,
.main-sidebar .nav-sidebar .nav-treeview .nav-link.active{
  background-color: #e8f1ff !important;
  color: #0b63c8 !important;
}
/* small transition for hover feel */
.main-sidebar .nav-sidebar .nav-link{ transition: background-color .12s ease, color .12s ease; }

/* Card header style like index card: big dark fonts and light gradient radius background */
.wd-card .wd-card-header{
  display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-radius:10px; margin-bottom:10px;
  background: linear-gradient(135deg, rgba(11,99,200,0.04), rgba(255,255,255,0.0));
}
.card-dark:not(.card-outline) > .card-header { background-color: #c7d4e0 !important; }
.card-danger:not(.card-outline) > .card-header { background-color: #c5d2e0 !important; }

/* Additional card header colors for other types */
.card-primary:not(.card-outline) > .card-header { background-color: #dbeefc !important; }
.card-info:not(.card-outline) > .card-header { background-color: #dff7f9 !important; }
.card-success:not(.card-outline) > .card-header { background-color: #eaf7ee !important; }
.card-warning:not(.card-outline) > .card-header { background-color: #fff7e6 !important; }

/* Ensure wd-card modifier headers use matching tints */
.wd-card--primary .wd-card-header{ background: linear-gradient(135deg,#dbeefc 0%, #ffffff 100%); }
.wd-card--info .wd-card-header{ background: linear-gradient(135deg,#dff7f9 0%, #ffffff 100%); }
.wd-card--success .wd-card-header{ background: linear-gradient(135deg,#eaf7ee 0%, #ffffff 100%); }
.wd-card--warning .wd-card-header{ background: linear-gradient(135deg,#fff7e6 0%, #ffffff 100%); }
.wd-card--danger .wd-card-header{ background: linear-gradient(135deg,#f7eaeb 0%, #ffffff 100%); }
.wd-card--dark .wd-card-header{ background: linear-gradient(135deg,#e3e8ee 0%, #ffffff 100%); }

/* Sidebar treeview background and rounded panels */
.main-sidebar .nav-sidebar > .nav-item > .nav-treeview {
  background-color: #f7f8fa;
  border-radius: 5px;
  margin: 6px 8px 0 8px;
  padding: 6px 6px;
}

/* Ensure nav-treeview items are hidden/shown by .menu-open rather than inline styles */
.nav-sidebar .nav-treeview{
  display: none;
  padding-left: 6px;
  margin: 0;
}
.nav-sidebar .nav-item.menu-open > .nav-treeview{
  display: block;
}

/* Keep submenu links readable */
.nav-sidebar .nav-treeview .nav-link{
  color: #000 !important;
  background: transparent;
  border-radius: 4px;
  padding: 6px 10px;
}

/* Keep main sidebar text black and background consistent */
.main-sidebar { background: #f7f8fa !important; color: #000; }
.main-sidebar .nav-sidebar .nav-link { color: #000; }
.main-sidebar .nav-sidebar .nav-link.active { background: #e9f2ff; color: #0b63c8; border-radius:6px; }
/* Chatbot reports page: enlarge and tighten card typography to match index */
.chat-report .card{ padding:0; border-radius:8px; min-height:70px; }
.chat-report .card .card-body{ padding:16px; font-size:15px; color:#111; }
.chat-report .card .card-header{ padding:12px 16px; background: linear-gradient(135deg,#dbeefc 0%, #ffffff 100%); color:#000; border-bottom:1px solid rgba(0,0,0,0.04); border-radius:8px 8px 0 0; }
.chat-report .card .card-header .card-title{ font-size:16px; font-weight:700; color:#111; }
.chat-report .summary-value{ font-size:28px !important; font-weight:800 !important; }
.chat-report .summary-label{ font-size:13px !important; color:#333; }
.chat-report .summary-cards .card{ display:flex; flex-direction:column; justify-content:center; align-items:center; padding:12px; }
.chat-report .small-controls .btn{ font-size:13px; padding:6px 8px; }
.chat-report .compact-list li{ font-size:14px; }
.chat-report .table-sm td, .chat-report .table-sm th{ font-size:13px; }

/* Ensure summary small cards visually use wd-card look if present */
.chat-report .summary-cards .wd-card-header{ display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-radius:8px; margin-bottom:8px; }
.chat-report .summary-cards .wd-card-header .title{ font-size:16px; font-weight:800; color:#071427; }
.chat-report .summary-cards .wd-card-header .subtitle{ font-size:12px; color:var(--wd-admin-muted); margin-left:8px; }
/* ensure the amount aligns to the right within the small card */
.chat-report .summary-cards .wd-card-amount{ font-size:28px !important; font-weight:800 !important; text-align:right; }
/* make each summary tile show header + amount vertically on small screens */
@media (max-width:767px){
  .chat-report .summary-cards{ flex-direction:column; }
  .chat-report .summary-cards > div{ width:100%; }
  .chat-report .summary-cards .wd-card-header{ padding:8px 10px; }
  .chat-report .summary-cards .wd-card-amount{ font-size:20px !important; }
}
.card .card-header { display:flex; align-items:center; }
.card .card-header .card-tools { margin-left: auto; }
.wd-card-header { display:flex; align-items:center; }
.wd-card-header .tools { margin-left:auto; display:flex; gap:8px; align-items:center; }
.sidebar-mode { display:flex; justify-content:flex-end; }
.sidebar-mode #sidebar-mode-toggle{ font-size:12px; padding:6px 8px; }
.nav-sidebar a.nav-link:focus{ outline: 2px solid rgba(11,99,200,0.14); outline-offset:2px; }
.wd-card .wd-card-header .title{ font-size:18px; font-weight:800; color:#071427; }
.wd-card .wd-card-header .subtitle{ font-size:13px; color:var(--wd-admin-muted); }


/* Tables - inspired by WowDash table-basic demo */
.wd-table { width:100%; border-collapse:collapse; background:#fff; border-radius:8px; overflow:hidden; }
.wd-table th, .wd-table td{ padding:12px 14px; text-align:left; border-bottom:1px solid #f1f5f9; }
.wd-table thead th{ background:linear-gradient(180deg, #fbfdff, #f7fbff); font-weight:700; color:#0b2a4a; }
.wd-table tbody tr:hover{ background: #fbfcff; }
.wd-table .avatar{ width:36px; height:36px; border-radius:50%; display:inline-block; vertical-align:middle; margin-right:8px; }

/* Pie chart container styles - inspired by WowDash pie-chart demo */
.wd-pie { display:flex; align-items:center; gap:18px; }
.wd-pie-graph{ width:140px; height:140px; border-radius:50%; position:relative; }
.wd-pie-legend{ display:flex; flex-direction:column; gap:8px; }
.wd-pie-legend .item{ display:flex; gap:8px; align-items:center; }
.wd-pie-legend .swatch{ width:12px; height:12px; border-radius:2px; }

/* Users grid - inspired by WowDash users-grid */
.wd-users-grid{ display:grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.wd-user-card{ background:#fff; border-radius:10px; padding:12px; display:flex; gap:12px; align-items:center; box-shadow:0 6px 18px rgba(9,30,66,0.04); }
.wd-user-card .meta{ display:flex; flex-direction:column; }
.wd-user-card .meta .name{ font-weight:700; }
.wd-user-card .meta .role{ font-size:13px; color:var(--wd-admin-muted); }

/* AI text area and generator styles (text-generator demo) */
.wd-ai { display:flex; flex-direction:column; gap:8px; }
.wd-ai textarea{ min-height:140px; padding:12px; border-radius:8px; border:1px solid #e6eef7; font-size:15px; }
.wd-ai .ai-actions{ display:flex; gap:8px; }

/* Email / Campaign form (email demo) */
.wd-email-form{ display:flex; flex-direction:column; gap:10px; }
.wd-email-form input, .wd-email-form textarea, .wd-email-form select{ padding:10px; border-radius:8px; border:1px solid #e6eef7; }

/* Reports card tweaks (index-5 demo) */
.wd-report-card{ padding:18px; border-radius:12px; background:#fff; box-shadow: 0 8px 30px rgba(11,99,200,0.04); }
