/* LeadFlow visual refresh
   Loaded after app.css so the existing markup keeps its behaviour while all
   screens share the same modern component language. */
:root {
  --ink: #14213d;
  --muted: #72819a;
  --line: #e4eaf3;
  --canvas: #f4f7fb;
  --card: #ffffff;
  --primary: #5b5ce8;
  --primary-dark: #4545c9;
  --primary-soft: #eeefff;
  --green: #159a73;
  --green-soft: #e7f8f1;
  --red: #df5361;
  --red-soft: #fff0f2;
  --amber: #c77a19;
  --amber-soft: #fff5df;
  --blue: #2877b5;
  --blue-soft: #eaf5ff;
  --shadow: 0 16px 45px rgba(27, 45, 83, .08);
  --radius: 20px;
}

body {
  background:
    radial-gradient(circle at 83% -18%, rgba(104, 101, 236, .11), transparent 34rem),
    var(--canvas);
  color: var(--ink);
  letter-spacing: -.01em;
}

/* Navigation and shell */
.sidebar {
  width: 268px;
  padding: 28px 16px 18px;
  background: linear-gradient(180deg, #101a36 0%, #0b142b 100%);
  border-right: 1px solid #253252;
  box-shadow: 14px 0 45px rgba(19, 33, 65, .08);
}
.brand { font-size: 19px; letter-spacing: -.8px; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7a6cff, #5144db);
  box-shadow: 0 9px 20px rgba(101, 92, 246, .4);
}
.workspace-switch {
  margin: 34px 6px 25px;
  min-height: 45px;
  border: 1px solid #2a3a60;
  border-radius: 13px;
  padding: 0 12px;
  background: rgba(255, 255, 255, .045);
  color: #b7c3db;
}
.side-nav { gap: 7px; }
.side-nav a {
  height: 46px;
  border-radius: 13px;
  padding: 0 14px;
  gap: 13px;
  color: #94a5c2;
}
.side-nav a i { font-size: 15px; color: #8597b8; }
.side-nav a:hover { background: rgba(121, 111, 255, .12); color: #fff; }
.side-nav a:hover i { color: #c8c4ff; }
.side-nav a.active {
  background: linear-gradient(100deg, #635bed, #514bd7);
  color: #fff;
  box-shadow: 0 9px 20px rgba(80, 73, 215, .28);
}
.side-nav a.active i { color: #fff; }
.nav-caption { margin: 27px 14px 8px; color: #647799; }
.sidebar-user { padding: 18px 7px 0; border-top-color: #263759; }
.sidebar-user strong { color: #f4f7ff; }
.sidebar-user small { color: #91a2bf; }
.sidebar .icon-btn { color: #9aacca; }
.sidebar .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-main { margin-left: 268px; width: calc(100% - 268px); }
.topbar {
  height: 82px;
  padding: 0 42px;
  background: rgba(255, 255, 255, .83);
  border-bottom: 1px solid rgba(221, 228, 240, .82);
  box-shadow: 0 5px 25px rgba(28, 44, 77, .04);
}
.global-search {
  height: 44px;
  width: min(500px, 54vw);
  border: 1px solid #e3e8f2;
  background: #f8faff;
  border-radius: 13px;
  padding: 0 14px;
}
.global-search:focus-within {
  border-color: #8d91ed;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(91, 92, 232, .10);
}
.global-search kbd {
  border: 1px solid #dce3ef;
  border-radius: 6px;
  padding: 3px 6px;
  color: #8592a9;
}
.page-content { max-width: 1540px; padding: 38px 42px 60px; }
.page-heading { margin-bottom: 29px; }
.page-heading h1 { font-size: 29px; letter-spacing: -1.6px; }
.page-heading h1 i { color: #7a6cff; font-size: .72em; vertical-align: 3px; }
.page-heading p { color: #7b89a1; }

/* Buttons, icons and focus states */
.button {
  min-height: 42px;
  height: auto;
  border-radius: 11px;
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: -.01em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary {
  background: linear-gradient(135deg, #6967f1, #514ed8);
  box-shadow: 0 8px 18px rgba(81, 78, 216, .22);
}
.button-primary:hover { background: linear-gradient(135deg, #5d5be5, #4543c5); box-shadow: 0 10px 22px rgba(81, 78, 216, .3); }
.button-secondary { border-color: #dfe5ef; background: #fff; color: #52617b; box-shadow: 0 3px 9px rgba(24, 38, 70, .04); }
.button-secondary:hover, .button-ghost:hover { background: #f5f6ff; border-color: #d2d7ff; color: #4e50cb; }
.button-danger { box-shadow: 0 8px 18px rgba(206, 67, 84, .18); }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; }
.icon-btn:hover { background: #f0f1ff; color: var(--primary); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(91, 92, 232, .22);
  outline-offset: 2px;
}

/* Cards, headings and dashboard surfaces */
.panel, .kpi-card, .lead-card, .lead-hero, .filter-panel {
  border-color: #e3e9f3;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-header { padding: 22px 23px 17px; }
.panel-header h2 { font-size: 16px; letter-spacing: -.55px; }
.panel-header p { color: #8794aa; }
.panel-body { padding: 0 23px 23px; }
.kpi-grid { gap: 18px; }
.kpi-card { padding: 20px; min-height: 145px; }
.kpi-card:hover { box-shadow: 0 20px 48px rgba(34, 51, 94, .13); }
.kpi-icon { width: 40px; height: 40px; border-radius: 13px; }
.kpi-number { font-size: 31px; margin-top: 20px; }
.kpi-label { color: #53627c; font-size: 12px; }
.kpi-foot { color: #91a0b5; }
.content-grid { gap: 21px; margin-top: 21px; }
.chart-wrap { height: 255px; }
.follow-counts { padding: 0 23px 18px; }
.follow-row { padding: 15px 0; }
.follow-icon { width: 39px; height: 39px; border-radius: 12px; }

/* Inputs: one component style across leads, settings, reports, team and modals */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d7dfec !important;
  border-radius: 12px !important;
  background: #fbfcff !important;
  color: #182641 !important;
  padding: 0 14px !important;
  box-shadow: inset 0 1px 2px rgba(27, 48, 88, .03), 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}
textarea { min-height: 116px; padding: 13px 14px !important; line-height: 1.55; resize: vertical; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):hover, select:hover, textarea:hover { border-color: #b9c5d9 !important; background: #fff !important; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus, select:focus, textarea:focus {
  border-color: #7375ed !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(91, 92, 232, .12), inset 0 1px 2px rgba(27, 48, 88, .03) !important;
}
input::placeholder, textarea::placeholder { color: #a2aec0; opacity: 1; }
select { appearance: none; padding-right: 42px !important; background-image: linear-gradient(45deg, transparent 50%, #71809a 50%), linear-gradient(135deg, #71809a 50%, transparent 50%) !important; background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px !important; background-size: 5px 5px, 5px 5px !important; background-repeat: no-repeat !important; }
.global-search input, .search-field input {
  min-height: 0 !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.global-search input:focus, .search-field input:focus { box-shadow: none !important; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); }
.select-compact { width: auto; min-width: 140px; min-height: 44px; }
.status-select { min-height: 31px !important; width: auto !important; border: 0 !important; border-radius: 999px !important; padding: 6px 25px 6px 10px !important; box-shadow: none !important; }
.form-field label, .filters-advanced label, form > label, .modal-card label { margin-bottom: 8px; color: #586781; letter-spacing: .02em; }
.form-grid { gap: 19px; }
.field-help, .subtle-text { color: #8b98ad; }
.field-error { margin-top: 6px; font-weight: 600; }

/* Leads table, filters and mobile cards */
.filter-panel { overflow: hidden; }
.filter-primary { padding: 17px; gap: 11px; }
.search-field { height: 46px; border-radius: 12px; border-color: #d7dfec; background: #fbfcff; padding: 0 14px; }
.search-field:focus-within { border-color: #7375ed; box-shadow: 0 0 0 4px rgba(91,92,232,.1); background: #fff; }
.filters-advanced { padding: 17px; gap: 15px; }
.active-chips { padding: 0 17px 16px; gap: 8px; }
.filter-chip { border: 1px solid #d9ddff; border-radius: 999px; background: #f1f1ff; color: #5559cf; padding: 7px 10px; }
.bulk-bar { border-radius: 13px; border-color: #dce0ff; background: #f1f2ff; padding: 10px 13px; }
.table-wrap { border-top-color: #edf0f5; }
table { min-width: 780px; }
th { padding: 14px 15px; background: #f8faff; color: #8491a7; }
td { padding: 15px; border-top-color: #edf0f5; }
tbody tr:hover { background: #fafbff; }
.lead-avatar { width: 34px; height: 34px; border-radius: 11px; background: #eef0ff; color: #595dd1; }
.pagination { padding: 16px 18px; border-top: 1px solid #edf0f5; }
.page-btn { min-width: 33px; height: 33px; border-radius: 9px; border-color: #e0e6f0; }
.lead-card { padding: 18px; }

/* Forms, imports, reports and team */
.form-panel { max-width: 980px; }
.form-panel .panel-body { padding: 25px; }
.form-actions { margin-top: 26px; padding-top: 20px; }
.details-list { gap: 20px; }
.detail-label { color: #91a0b5; }
.detail-value { color: #263653; }
.report-filter { padding: 18px; border-radius: var(--radius); gap: 14px; }
.metric-row { gap: 16px; }
.metric { border: 1px solid #e3e9f3; border-radius: 17px; box-shadow: var(--shadow); background: #fff; }
.upload-zone { min-height: 270px; border-radius: 20px; background: linear-gradient(145deg,#fbfcff,#f4f5ff); }
.summary-box { border: 1px solid #e6eaf3; border-radius: 13px; background: #fafbff; padding: 15px; }
.team-grid { gap: 18px; }
.team-card { border-color: #e3e9f3; border-radius: 18px; padding: 19px; box-shadow: 0 10px 28px rgba(28,45,85,.05); }
.team-card:hover { border-color: #cfd2ff; box-shadow: 0 16px 34px rgba(57,58,145,.11); transform: translateY(-2px); transition: .18s ease; }
.team-card-meta { padding: 16px 0; margin: 17px 0; }
.modal-layer { background: rgba(14, 25, 54, .62); backdrop-filter: blur(5px); }
.modal-card { border: 1px solid #e1e6f1; border-radius: 21px; padding: 27px; box-shadow: 0 30px 90px rgba(7,16,46,.28); }
.modal-close { width: 34px; height: 34px; border-radius: 10px; }

/* Sign-in refresh */
.login-body { background: #f3f5fb; }
.login-promo { background: linear-gradient(145deg, #111c3b, #29327c 55%, #514bd7); }
.login-panel { background: radial-gradient(circle at 20% 20%, rgba(103,101,241,.08), transparent 24rem); }
.login-card { padding: 34px; border: 1px solid #e3e8f2; border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: 0 24px 65px rgba(35,49,92,.1); }
.login-card .muted { color: #8290a8; }
.auth-form label { color: #53617b; }
.input-icon input { padding-left: 40px !important; }
.password-toggle { right: 5px; top: 6px; }

/* Dark mode */
body.dark { --canvas: #111827; --card: #192236; --line: #2b3852; --ink: #eef2ff; --muted: #a9b6ca; --primary-soft: #292b63; --shadow: 0 15px 40px rgba(0,0,0,.2); }
body.dark .topbar { background: rgba(20, 29, 48, .88); border-bottom-color: #2b3852; }
body.dark .panel, body.dark .kpi-card, body.dark .lead-card, body.dark .lead-hero, body.dark .filter-panel, body.dark .metric, body.dark .modal-card { border-color: #2c3954; }
body.dark input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), body.dark select, body.dark textarea { color: #edf2ff !important; background: #202c43 !important; border-color: #3a4965 !important; }
body.dark input::placeholder, body.dark textarea::placeholder { color: #8190aa; }
body.dark input:focus, body.dark select:focus, body.dark textarea:focus { background: #24314a !important; }
body.dark th { background: #202b42; }
body.dark td { border-top-color: #2b3852; color: #c7d1e3; }
body.dark .search-field, body.dark .global-search { background: #1d2940; border-color: #34425d; }
body.dark .search-field input, body.dark .global-search input { background: transparent !important; }
body.dark .button-secondary { border-color: #3a4965; background: #202c43; color: #d5deed; }
body.dark .login-card { background: #192236; border-color: #2d3b56; }

@media (max-width: 900px) {
  .sidebar { width: 268px; }
  .app-main { margin-left: 0; width: 100%; }
  .topbar { padding: 0 22px; }
  .page-content { padding: 30px 22px 90px; }
}
@media (max-width: 680px) {
  .topbar { height: 72px; padding: 0 15px; }
  .page-content { padding: 24px 15px 88px; }
  .page-heading h1 { font-size: 24px; }
  .panel-header { padding: 18px; }
  .panel-body { padding: 0 18px 18px; }
  .filter-primary { padding: 13px; }
  .form-panel .panel-body { padding: 19px; }
  .login-card { padding: 25px 21px; border-radius: 20px; }
}
