body { font-family: "Inter", Arial, sans-serif; margin: 0; background: #f5f5f5; color: #1f1f1f; }
body.login-body {
  background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.85)), url("/bg.png") center top/cover no-repeat fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-logo { width: 220px; height: auto; max-width: 100%; object-fit: contain; margin-bottom: 10px; display: block; filter: drop-shadow(0 10px 24px rgba(0,0,0,0.45)); }
.login-header { display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-card { width: min(420px, 92vw); background: #ffffff; border-radius: 18px; padding: 24px; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35); overflow: visible; }
.login-card .field input { box-sizing: border-box; width: 100%; }
.login-header h2 { margin: 0; font-size: 22px; color: #0f172a; }
.login-header p { margin: 6px 0 0 0; }
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 0; background: transparent; padding: 0; }
.header-title { margin: 0; font-size: 20px; color: #f8fafc; letter-spacing: 0.2px; }
.app-shell { display: flex; min-height: 100vh; background: #f5f5f5; }
.sidebar { width: 240px; background: #ffffff; border-right: 1px solid #e0e0e0; padding: 18px 14px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.sidebar-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 6px;
  position: sticky;
  bottom: 0;
  background: #ffffff;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px; }
.sidebar-logo { width: 40px; height: 40px; object-fit: contain; }
.sidebar-title { font-weight: 700; letter-spacing: 0.04em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; padding-right: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #1f1f1f; text-decoration: none; font-weight: 600; transition: background 0.15s ease, color 0.15s ease; }
.nav-link:hover { background: #f1f1f1; }
.nav-link.active { background: #e8f0fe; color: #0b57d0; }
.nav-link.primary { background: #0b57d0; color: #ffffff; }
.nav-icon svg { width: 20px; height: 20px; display: block; }
.sidebar-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 6px;
  position: sticky;
  bottom: 0;
  background: #ffffff;
}
.sidebar-toggle { margin-top: 6px; border: 1px solid #e0e0e0; background: #ffffff; color: #1f1f1f; border-radius: 10px; padding: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sidebar-toggle svg { width: 18px; height: 18px; transition: transform 0.2s ease; }
body.sidebar-collapsed .sidebar { width: 76px; }
body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .nav-label { display: none; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; }
body.sidebar-collapsed .sidebar-logo { width: 32px; height: 32px; }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-greeting { margin: 0 0 12px 0; font-size: 22px; font-weight: 700; color: #0f172a; letter-spacing: 0.2px; }
.login-tabs { display: flex; gap: 8px; margin: 18px 0 12px; }
.login-tab { flex: 1; border-radius: 12px; border: 1px solid #e2e8f0; background: #f8fafc; padding: 8px 10px; font-weight: 600; cursor: pointer; }
.login-tab.active { background: #1f7a45; color: #fff; border-color: #1f7a45; }
.login-btn { width: 100%; justify-content: center; }
.login-hint { margin: 4px 0 10px; }
.analytics-fallback-pill { display: inline-flex; align-items: center; gap: 6px; background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 12px; margin-top: 8px; }
.fallback-card { border-color: #fecaca; box-shadow: 0 10px 24px rgba(239, 68, 68, 0.12); position: relative; }
.fallback-card::after { content: "Fallback"; position: absolute; top: 12px; right: 12px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; }
body.thermometer-body { background: #000; color: #fff; }
body.thermometer-body .sidebar,
body.thermometer-body .topbar { display: none; }
body.thermometer-body .container { max-width: none; margin: 0; padding: 0; background: transparent; box-shadow: none; border-radius: 0; }
header { background: transparent; padding: 0; border-bottom: 0; position: static; color: inherit; }
.container a { color: inherit; }
.container { max-width: none; margin: 0; background: transparent; padding: 24px; border-radius: 0; box-shadow: none; }
.hero { background: #e9f6ef; border-radius: 16px; padding: 18px 20px; border: 1px solid #d4efe0; margin-bottom: 22px; }
.hero h3 { margin: 0 0 6px 0; color: #1f7a45; }
.hero p { margin: 0; color: #475569; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: #1f7a45; color: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 600; box-shadow: 0 6px 14px rgba(31, 122, 69, 0.22); }
.stat-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-weight: 600; border: 1px solid #e0e7ff; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
.dashboard-grid .grid-span-2 { grid-column: 1 / -1; }
.card-centered { text-align: center; align-items: center; }
.card-centered > * { align-self: center; }
.utm-goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-card { border-radius: 16px; padding: 16px; background: #ffffff; border: 1px solid #e0e0e0; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.chart-title { margin: 0 0 10px 0; font-size: 14px; color: #475569; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 90px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 13px; color: #1f2937; }
.bar-track { height: 10px; background: #e9eef6; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 10px; background: #22c55e; border-radius: 999px; }
.progress-animated .bar-fill {
  width: 0%;
  background: linear-gradient(90deg, #22c55e 0%, #4ade80 50%, #16a34a 100%);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.45);
  animation: progress-fill 1.4s ease-out forwards;
  position: relative;
}
.progress-animated .bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: progress-shine 2.2s ease-in-out infinite;
}
.progress-animated .bar-fill.blue {
  width: 0%;
  background: linear-gradient(90deg, #2563eb 0%, #60a5fa 50%, #1d4ed8 100%);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.35);
  animation: progress-fill 1.4s ease-out forwards;
}
@keyframes progress-fill {
  from { width: 0%; }
  to { width: var(--progress, 0%); }
}
@keyframes progress-shine {
  0% { transform: translateX(-100%); }
  60% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}
.bar-fill.blue { background: #3b82f6; }
.top-urls { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.country-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.top-card { border-radius: 16px; padding: 16px; border: 1px solid #e0e0e0; background: #ffffff; box-shadow: 0 2px 6px rgba(0,0,0,0.08); overflow: hidden; }
.analytics-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.analytics-card { display: flex; flex-direction: column; gap: 10px; }
.analytics-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.analytics-card-meta { font-size: 12px; }
.analytics-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.analytics-card-grid strong { font-size: 16px; color: #111827; }
.value-positive { color: #188038; }
.value-zero { color: #b3261e; }
.btn-sm { padding: 6px 12px; border-radius: 10px; font-size: 13px; }
.analytics-card .btn-secondary { background: #0b57d0 !important; color: #ffffff !important; border-color: #0b57d0 !important; }
.analytics-card .btn-secondary:hover { background: #0a4cb8 !important; color: #ffffff !important; }
.site-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.site-card { display: flex; flex-direction: column; gap: 12px; }
.site-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-card-meta { display: flex; align-items: center; justify-content: space-between; }
.site-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-card-actions form { margin: 0; }

.btn-view { background: #0b57d0 !important; color: #ffffff !important; border-color: #0b57d0 !important; }
.btn-view:hover { background: #0a4cb8 !important; }
.btn-sync { background: #1e8e3e !important; color: #ffffff !important; border-color: #1e8e3e !important; }
.btn-sync:hover { background: #188038 !important; }
.btn-delete { background: #b3261e !important; color: #ffffff !important; border-color: #b3261e !important; }
.btn-delete:hover { background: #a50e0e !important; }
.chart-card .btn-secondary { background: #e8f0fe; color: #0b57d0; border-color: #d2e3fc; }
.chart-card .btn-secondary:hover { background: #d2e3fc; }
.chart-card .btn { background: #0b57d0; }
.top-card .btn-secondary { background: #e8f0fe; color: #0b57d0; border-color: #d2e3fc; }
.top-card .btn-secondary:hover { background: #d2e3fc; }
.top-card .btn { background: #0b57d0; }
.top-card h4 { margin: 0 0 10px 0; font-size: 15px; }
.top-card .table-wrap table { min-width: 0; }
.top-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid #edf0f6; align-items: start; }
.top-item > div { min-width: 0; }
.top-item .muted { word-break: break-word; }
.top-item > div:last-child { white-space: nowrap; }
.top-item:last-child { border-bottom: 0; }
.muted { color: #64748b; font-size: 12px; }
.split-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.split-card { border-radius: 18px; border: 1px solid #e6edf4; background: #fff; padding: 16px; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.split-card-header { display: flex; gap: 12px; align-items: center; min-width: 0; }
.split-card-header h3 { margin: 0; font-size: 16px; color: #0f172a; }
.split-avatar { width: 56px; height: 56px; border-radius: 16px; background: #e6f4ea; color: #1f7a45; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; }
.split-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.split-meta-item { color: #475569; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.split-status { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.split-status.active { background: #ecfdf3; color: #047857; border: 1px solid #a7f3d0; }
.split-status.inactive { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.split-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.split-actions-right { display: flex; gap: 8px; flex-wrap: wrap; }
.split-copy-btn { background: #22c55e; }
@media (max-width: 1200px) {
  .split-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .split-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .split-grid { grid-template-columns: 1fr; }
}
.country-grid { display: grid; grid-template-columns: minmax(140px, 1fr) 100px 100px 100px; gap: 6px 10px; align-items: center; }
.country-head { font-weight: 700; color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding-bottom: 6px; border-bottom: 1px solid #edf0f6; }
.country-head-left { text-align: left; }
.country-head-right { text-align: right; }
.country-cell { padding: 6px 0; border-bottom: 1px solid #edf0f6; font-size: 13px; }
.country-cell:last-child { border-bottom: 1px solid #edf0f6; }
.country-name { font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-value { white-space: nowrap; font-weight: 600; color: #0f172a; text-align: right; }
@media (max-width: 1100px) {
  .country-cards { grid-template-columns: 1fr; }
}
.utm-total-card { background: #ffffff; border-color: #e6edf4; text-align: center; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; min-height: 140px; }
.utm-total-card .utm-total-row { justify-content: center; }
.utm-total-card .chart-title { font-size: 14px; color: #3f4b5f; }
.utm-total-value { font-size: 52px; font-weight: 800; color: #15803d; letter-spacing: 0.4px; line-height: 1.05; }
.utm-total-sub { color: #4b5563; font-size: 14px; margin-top: 8px; }
.fx-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.fx-card .fx-value { font-size: 40px; font-weight: 800; color: #15803d; letter-spacing: 0.4px; line-height: 1.1; }
.utm-total-row { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.refresh-inline { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 999px; border: 1px solid rgba(15, 23, 42, 0.12); color: #64748b; background: transparent; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.refresh-inline:hover { transform: translateY(-1px); color: #0f172a; border-color: rgba(15, 23, 42, 0.25); box-shadow: 0 6px 12px rgba(15, 23, 42, 0.1); }
.refresh-inline svg { width: 14px; height: 14px; display: block; }
.privacy-toggle { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; color: #475569; border-radius: 8px; padding: 4px; cursor: pointer; }
.privacy-toggle:hover { background: #f1f5f9; }
.icon-eye { width: 18px; height: 18px; display: block; }
.icon-eye .eye-off { opacity: 0; }
.privacy-blur .icon-eye .eye-off { opacity: 1; }
.privacy-blur .privacy-number {
  filter: blur(22px);
  opacity: 0.12;
  text-shadow: 0 0 22px rgba(21, 128, 61, 0.5);
  letter-spacing: 2px;
  transform: scale(1.03);
}
.thermo-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 56px 24px 44px;
  background: url("/bg.png") center/cover no-repeat fixed;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.thermo-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 18%, rgba(255,255,255,0.08), transparent 40%),
              linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.85));
  z-index: 0;
}
.thermo-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 18px;
  background: rgba(10,10,10,0.7);
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 2;
}
.thermo-logo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
  background: rgba(255,255,255,0.02);
}
.thermo-brand-text { display: flex; flex-direction: column; gap: 4px; }
.thermo-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f8fafc;
}
.thermo-subtitle {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(226,232,240,0.85);
}
.thermo-gauge {
  width: min(92vw, 980px);
  margin-top: 10px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.45));
}
.thermo-svg { width: 100%; height: auto; }
.thermo-arc-base { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 26; stroke-linecap: round; }
.thermo-arc-progress {
  fill: none;
  stroke: url(#thermoGradient);
  stroke-width: 26;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  stroke-dashoffset: 0;
  animation: arc-fill 1.4s ease-out forwards;
}
.thermo-needle {
  stroke: #f8fafc;
  stroke-width: 4;
  transform-origin: 200px 200px;
  transform: rotate(var(--needle-angle, -90deg));
  animation: needle-sweep 1.4s ease-out forwards;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.35));
}
.thermo-center { fill: #0b1220; stroke: #f8fafc; stroke-width: 3; filter: drop-shadow(0 0 12px rgba(255,255,255,0.4)); }
.thermo-legend { display: flex; align-items: center; gap: 12px; color: rgba(226,232,240,0.8); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; position: relative; z-index: 1; }
.thermo-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.thermo-dot.red { background: #ef4444; }
.thermo-dot.yellow { background: #f59e0b; }
.thermo-dot.green { background: #22c55e; }
.thermo-gauge .thermo-needle,
.thermo-gauge .thermo-arc-progress {
  animation-delay: 0.15s;
}
@keyframes arc-fill {
  from { stroke-dasharray: 0 100; }
  to { stroke-dasharray: var(--progress, 0) 100; }
}
@keyframes needle-sweep {
  from { transform: rotate(-90deg); }
  to { transform: rotate(var(--needle-angle, -90deg)); }
}
.thermo-settings { position: fixed; right: 24px; bottom: 24px; background: rgba(15, 23, 42, 0.85); border: 1px solid rgba(148, 163, 184, 0.35); padding: 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 8px; color: #e2e8f0; }
.thermo-settings label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.thermo-inputs { display: flex; gap: 8px; }
.thermo-inputs input { width: 160px; padding: 8px 10px; border-radius: 8px; border: 1px solid #475569; background: #0f172a; color: #e2e8f0; }
.line-chart { width: 100%; height: 80px; background: #f8fafc; border-radius: 12px; border: 1px solid #e6edf4; }
.multi-line-chart { width: 100%; height: 160px; background: #f8fafc; border-radius: 12px; border: 1px solid #e6edf4; }
.chart-plot { background: #f8fafc; border: 1px solid #e0e0e0; border-radius: 12px; padding: 8px; }
.chart-plot .multi-line-chart { border: 0; background: transparent; }
.chart-grid line { stroke: #e5e7eb; stroke-width: 0.5; }
.chart-line { stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill-opacity: 0; }
.chart-x-axis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; font-size: 11px; color: #6b7280; margin-top: 6px; }
.chart-x-axis span { text-align: center; }
.legend-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #334155; background: #f8fafc; border: 1px solid #e2e8f0; padding: 4px 8px; border-radius: 999px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.site-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.site-filter .select-wrap { position: relative; min-width: 260px; }
.site-filter select { width: 100%; padding: 10px 36px 10px 12px; border-radius: 12px; border: 1px solid #d8dee9; background: #fff; appearance: none; -webkit-appearance: none; -moz-appearance: none; box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06); }
.site-filter .select-wrap:after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #64748b; pointer-events: none; }
.table-wrap { width: 100%; overflow-x: auto; border-radius: 12px; border: 1px solid #e6edf4; background: #ffffff; }
.table-wrap table { margin-top: 0; min-width: 720px; }
.table-wrap th { position: sticky; top: 0; z-index: 1; }
table { width: 100%; border-collapse: collapse; margin-top: 16px; }

.tab-bar {
  display: inline-flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  margin: 10px 0 12px;
  padding: 6px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5f5;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.tab-panel {
  display: none;
  margin-top: 8px;
}

.tab-panel.active {
  display: block;
}
th, td { padding: 14px 12px; border-bottom: 1px solid #edf0f6; text-align: left; font-size: 14px; }
th { background: #f7f8fb; color: #475569; font-weight: 600; }
tr:hover td { background: #fafbff; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: #0b57d0; color: #fff; text-decoration: none; border-radius: 999px; border: 0; cursor: pointer; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,0.18); transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: #f1f3f4; color: #1f1f1f; box-shadow: none; border: 1px solid #e0e0e0; }
.btn-secondary:hover { background: #e8eaed; }
.chart-card .btn.btn-secondary,
.top-card .btn.btn-secondary,
.analytics-card .btn.btn-secondary {
  background: #e8f0fe !important;
  color: #0b57d0 !important;
  border-color: #d2e3fc !important;
}
.chart-card .btn.btn-secondary:hover,
.top-card .btn.btn-secondary:hover,
.analytics-card .btn.btn-secondary:hover {
  background: #d2e3fc !important;
  color: #0b57d0 !important;
}
.btn-danger { background: #b3261e; box-shadow: 0 4px 10px rgba(179, 38, 30, 0.24); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; color: #1f2937; }
.field input, .field textarea, .field select { width: 100%; padding: 12px 14px; border: 1px solid #e0e0e0; border-radius: 12px; background: #fff; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: #0b57d0; box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.15); }
.message { padding: 12px 14px; margin-bottom: 16px; border-radius: 10px; }
.message.success { background: #ecfdf3; color: #065f46; border: 1px solid #a7f3d0; }
.message.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.actions a { margin-right: 6px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: #64748b; }
.divider:before, .divider:after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
.url-card { border: 1px solid #e6ebf3; border-radius: 18px; padding: 18px; margin-bottom: 16px; background: #fbfcff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6); }
.url-card h4 { margin: 0 0 12px 0; color: #0f172a; }
.url-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: start; }
.url-grid .field { margin-bottom: 0; }
.config-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
.config-box { border-radius: 16px; padding: 16px; border: 1px solid #d8e6f7; background: #f6f9ff; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.config-box.green { border-color: #cfe5c6; background: #eef7e9; }
.slider { width: 100%; accent-color: #1f6f3b; }
#details-modal > div { box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2); }
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); align-items: center; justify-content: center; z-index: 999; }
.modal-card { background: #fff; border-radius: 16px; padding: 20px; width: 90%; max-width: 720px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2); }
.modal-card h3 { margin: 0 0 8px 0; }
.form-card { background: #ffffff; border: 1px solid #e6ebf3; border-radius: 18px; padding: 20px; box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04); }
.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.date-filter { display: grid; grid-template-columns: 260px 260px auto; column-gap: 32px; row-gap: 12px; align-items: end; max-width: 900px; }
.date-filter .field { margin-bottom: 0; }
.date-filter-input { width: 100%; min-width: 0; }
.date-filter-btn { height: auto; width: auto; padding: 11px 14px; line-height: 1.2; justify-content: center; font-size: 14px; }
.field.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field.inline label { margin: 0; font-weight: 600; }
.toggle { display: flex; align-items: center; gap: 12px; }
.switch { position: relative; display: inline-block; width: 52px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-toggle { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #e2e8f0; border-radius: 999px; transition: 0.2s; border: 1px solid #d8dee9; }
.slider-toggle:before { content: ""; position: absolute; height: 22px; width: 22px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18); }
.switch input:checked + .slider-toggle { background: #1f6f3b; border-color: #1f6f3b; }
.switch input:checked + .slider-toggle:before { transform: translateX(24px); }
.toggle-text { font-weight: 600; color: #0f172a; }
.url-card .btn-secondary { margin-top: 10px; }
.form-card .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.user-actions form { margin: 0; display: inline-flex; }
.user-actions button { white-space: nowrap; }
.btn-warning { background: #f59e0b !important; color: #1f2937 !important; box-shadow: 0 8px 16px rgba(245, 158, 11, 0.18); }
.btn-warning:hover { background: #fbbf24 !important; }
.form-card .field { min-width: 0; }
.form-card .field input,
.form-card .field select,
.form-card .field textarea { box-sizing: border-box; }
.form-card textarea { min-height: 120px; }
.url-card input,
.url-card select,
.url-card textarea { box-sizing: border-box; }
.url-card h4 { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid #eef2f7; }
.config-box strong { font-size: 14px; color: #0f172a; }
.config-box p { color: #475569; }
.config-box output { display: inline-block; min-width: 36px; text-align: right; font-weight: 600; color: #0f172a; }
.config-box .slider { margin-top: 6px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .url-grid, .config-grid, .dashboard-grid, .top-urls { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .sidebar { width: 76px; }
  .sidebar-title,
  .nav-label { display: none; }
  .sidebar-brand { justify-content: center; }
  .sidebar-logo { width: 32px; height: 32px; }
  .sidebar-toggle { display: none; }
}
@media (max-width: 640px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 64px;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    background: #000;
    border-right: 0;
    border-top: 1px solid #111;
    z-index: 60;
    justify-content: space-evenly;
  }
  .sidebar-brand,
  .sidebar-toggle { display: none !important; }
  .sidebar-actions,
  .sidebar-nav { display: contents; }
  .nav-link {
    padding: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: rgb(187 209 0) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .nav-link.active { background: rgba(187, 209, 0, 0.18) !important; color: rgb(187 209 0) !important; }
  .nav-link:hover { background: rgba(187, 209, 0, 0.12) !important; color: rgb(187 209 0) !important; }
  .nav-icon { display: flex; align-items: center; justify-content: center; }
  .nav-icon svg { width: 26px; height: 26px; stroke: rgb(187 209 0) !important; fill: rgb(187 209 0) !important; }
  .nav-label { display: none; }
  .sidebar-actions .nav-link { width: 44px; height: 44px; }
  .sidebar-actions .nav-link.primary { background: transparent !important; box-shadow: none; color: rgb(187 209 0) !important; }
  .sidebar-actions .nav-link { color: rgb(187 209 0) !important; }
  .sidebar-actions .nav-link svg { stroke: currentColor !important; fill: currentColor !important; }
  .app-main { padding-bottom: 84px; }
  .container { padding: 16px; }
}