/* ===================================================
   Qolai Design System
   Strict, minimalist, unified
   =================================================== */

/* === Design Tokens === */
:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-dark: #1b2838;
  --color-dark-gradient: #2d3f54;
  --color-text: #1e293b;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-bg: #f0f2f5;
  --color-card: #fff;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;
  --color-success-text: #15803d;
  --color-danger: #dc2626;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;
  --color-info-text: #1e40af;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 2.5rem;
  --space-3xl: 3rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-hover: 0 8px 20px rgba(0,0,0,0.08);
  --shadow-primary: 0 4px 12px rgba(37,99,235,0.25);
  --shadow-focus: 0 0 0 3px rgba(37,99,235,0.1);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;

  /* Typography */
  --font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.72rem;
  --font-size-sm: 0.82rem;
  --font-size-base: 0.9rem;
  --font-size-md: 0.95rem;
  --font-size-lg: 1.05rem;
  --font-size-xl: 1.3rem;
  --font-size-2xl: 1.6rem;
  --font-size-3xl: 2.2rem;
  --line-height-base: 1.6;
  --line-height-tight: 1.25;
  --line-height-relaxed: 1.8;
}

/* === Dark Theme Overrides === */
[data-bs-theme="dark"] {
  --color-primary: #3b82f6;
  --color-primary-hover: #60a5fa;
  --color-dark: #0d1117;
  --color-dark-gradient: #161b22;
  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-light: #475569;
  --color-bg: #0d1117;
  --color-card: #161b22;
  --color-border: #21262d;
  --color-border-hover: #30363d;
  --color-success: #22c55e;
  --color-success-bg: #0d1f12;
  --color-success-border: #14532d;
  --color-success-text: #4ade80;
  --color-danger: #ef4444;
  --color-warning-bg: #1c1305;
  --color-warning-border: #3b2f04;
  --color-info-bg: #0c1629;
  --color-info-border: #1e3a5f;
  --color-info-text: #93c5fd;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-hover: 0 8px 20px rgba(0,0,0,0.4);
  --shadow-primary: 0 4px 12px rgba(59,130,246,0.3);
  --shadow-focus: 0 0 0 3px rgba(59,130,246,0.25);
}

[data-bs-theme="dark"] .dropdown-item:hover { background: #21262d; }
[data-bs-theme="dark"] .faq-section .accordion-button { background: var(--color-card); }
[data-bs-theme="dark"] .faq-section .accordion-button:not(.collapsed) { background: #1c2128; color: var(--color-primary); }
[data-bs-theme="dark"] .content-article h3 { color: #cbd5e1; }
[data-bs-theme="dark"] .row-total { background: #1a0f0f !important; }
[data-bs-theme="dark"] footer { background: #010409; }
[data-bs-theme="dark"] footer h6 { color: #c9d1d9; }
[data-bs-theme="dark"] footer a { color: #8b949e; }
[data-bs-theme="dark"] footer a:hover { color: #c9d1d9; }
[data-bs-theme="dark"] .page-404 h1 { color: #30363d; }
[data-bs-theme="dark"] .search-box input { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
[data-bs-theme="dark"] .search-box input:focus { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }
[data-bs-theme="dark"] .navbar { background: #010409 !important; }
[data-bs-theme="dark"] .trust-bar { background: var(--color-card); border-color: var(--color-border); }

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: none;
  font-size: 1.1rem;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.theme-toggle:hover { opacity: 1; }

/* === Base === */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  font-family: var(--font-family);
  color: var(--color-text);
  line-height: var(--line-height-base);
}

main { flex: 1; }

/* === Navbar === */
.navbar {
  background: var(--color-dark) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0.6rem 0;
}

.navbar-brand {
  font-size: 1.35rem;
  letter-spacing: -0.3px;
  transition: opacity var(--transition-fast);
}

.navbar-brand:hover { opacity: 0.85; }
.navbar-logo { border-radius: var(--radius-sm); flex-shrink: 0; }
.navbar .nav-link { font-size: var(--font-size-base); }

.dropdown-menu {
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 0.4rem;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.8rem;
  font-size: 0.88rem;
}

.dropdown-item .bi {
  margin-right: 0.4rem;
}

.dropdown-item:hover { background: #f1f5f9; }

/* === Hero / Search === */
.hero {
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-gradient) 100%);
  color: #fff;
  padding: var(--space-2xl) 0 var(--space-xl);
}

.hero h1 {
  font-weight: 800;
  letter-spacing: -0.5px;
  font-size: var(--font-size-3xl);
}

.hero .lead { color: var(--color-text-light); font-size: var(--font-size-lg); }

.search-box {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.search-box input {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  font-size: 1rem;
  background: rgba(255,255,255,0.08);
  color: #fff;
  transition: all var(--transition-normal);
  width: 100%;
}

.search-box input::placeholder { color: #8b95a5; }

.search-box input:focus {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
  color: #fff;
}

.search-box .bi-search {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8b95a5;
  font-size: 1rem;
}

/* === Trust Bar === */
.trust-bar {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  padding: 0.6rem 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.trust-bar .trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.trust-bar .trust-item i { color: var(--color-success); font-size: var(--font-size-base); }

/* === Breadcrumbs === */
.breadcrumb-wrap { padding: 0.7rem 0 0; }

.breadcrumb-wrap .breadcrumb {
  margin-bottom: 0;
  font-size: var(--font-size-sm);
  background: none;
  padding: 0;
}

.breadcrumb-wrap .breadcrumb-item a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-wrap .breadcrumb-item a:hover { color: var(--color-primary); }
.breadcrumb-wrap .breadcrumb-item.active { color: var(--color-text-light); }

/* === Page Header === */
.page-header { margin-bottom: var(--space-lg); }

.page-header h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.page-header .page-desc {
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  margin: 0;
}

.page-header .badge-update {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: var(--space-sm);
  vertical-align: middle;
  white-space: nowrap;
}

/* === Tool Cards (Homepage) === */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.9rem;
}

.tool-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.4rem 0.9rem;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.tool-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  color: var(--color-text);
  border-color: var(--color-border-hover);
}

.tool-tile .icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: #fff;
}

.tool-tile .name {
  font-weight: 600;
  font-size: 0.87rem;
  line-height: var(--line-height-tight);
}

.tool-tile .desc {
  font-size: 0.73rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.tool-tile[data-hidden="true"] { display: none; }

/* Icon colors */
.icon-blue    { background: #2563eb; }
.icon-green   { background: #16a34a; }
.icon-orange  { background: #ea580c; }
.icon-purple  { background: #7c3aed; }
.icon-red     { background: #dc2626; }
.icon-teal    { background: #0d9488; }
.icon-indigo  { background: #4f46e5; }
.icon-cyan    { background: #0891b2; }
.icon-pink    { background: #db2777; }
.icon-slate   { background: #475569; }
.icon-amber   { background: #d97706; }
.icon-lime    { background: #65a30d; }

/* === Section Headers === */
.section-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-light);
  margin-bottom: 0.8rem;
}

/* === Page Cards === */
.page-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

/* === Results === */
.calc-result {
  background: var(--color-success-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  font-size: var(--font-size-lg);
  border: 1px solid var(--color-success-border);
}

.calc-result strong { color: var(--color-success-text); }

/* Result table row highlights */
.row-highlight {
  background: var(--color-warning-bg) !important;
}

.row-highlight td { background: inherit !important; }

.row-total {
  background: #fef2f2 !important;
}

.row-total td { background: inherit !important; }

.row-success {
  background: var(--color-success-bg) !important;
}

.row-success td { background: inherit !important; }

.row-info {
  background: var(--color-info-bg) !important;
}

.row-info td { background: inherit !important; }

/* === Forms === */
.form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.form-select-lg {
  font-size: 1rem;
}

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-primary);
}

.btn-outline-primary {
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  transition: all var(--transition-fast);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline-primary:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  transition: all var(--transition-fast);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

.btn-outline-secondary:hover {
  color: var(--color-text);
  background: var(--color-bg);
  border-color: var(--color-text-muted);
  transform: translateY(-1px);
}

/* === FAQ Accordion === */
.faq-section { margin-top: var(--space-2xl); }

.faq-section h2 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.faq-section .accordion-item {
  border: 1px solid var(--color-border);
  border-radius: 10px !important;
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.faq-section .accordion-button {
  font-weight: 600;
  font-size: var(--font-size-md);
  color: var(--color-text);
  padding: var(--space-md) 1.2rem;
  background: var(--color-card);
}

.faq-section .accordion-button:not(.collapsed) {
  background: #f8fafc;
  color: var(--color-primary);
  box-shadow: none;
}

.faq-section .accordion-button:focus { box-shadow: none; }

.faq-section .accordion-body {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  padding: 0 1.2rem 1.2rem;
}

/* === Content Articles === */
.content-article {
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.content-article h2 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.content-article h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #334155;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.content-article p {
  font-size: 0.93rem;
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: 0.8rem;
}

.content-article ul, .content-article ol {
  font-size: 0.93rem;
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  padding-left: var(--space-lg);
}

.content-article .info-box {
  background: var(--color-info-bg);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-md) 1.2rem;
  margin: var(--space-md) 0;
  font-size: var(--font-size-base);
  color: var(--color-info-text);
}

/* === Copy Button === */
.btn-copy {
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-copy.copied {
  color: var(--color-success);
  border-color: var(--color-success);
}

/* === Tables in results === */
.table-rounded {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.schedule-wrap {
  max-height: 400px;
  overflow-y: auto;
}

/* Inline input in text (percent page) */
.input-inline {
  width: 100px;
  display: inline-block;
  vertical-align: baseline;
}

.input-inline-sm {
  width: 80px;
  display: inline-block;
  vertical-align: baseline;
}

/* Password display */
.password-display {
  font-size: 1.1rem;
  word-break: break-all;
}

/* === Footer === */
footer {
  background: var(--color-dark);
  color: var(--color-text-light);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-3xl);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

footer h6 {
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
}

footer a {
  color: var(--color-text-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

footer a:hover { color: #e2e8f0; }

footer .footer-links { list-style: none; padding: 0; margin: 0; }
footer .footer-links li { margin-bottom: 0.35rem; }
footer .footer-links a { font-size: 0.83rem; }

footer .footer-desc {
  font-size: 0.83rem;
}

footer .footer-updated {
  font-size: 0.8rem;
}

footer .footer-sources {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

footer .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: var(--space-md);
  margin-top: var(--space-lg);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* === Legal Pages === */
.legal-content { max-width: 800px; margin: 0 auto; }

.legal-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.legal-content p, .legal-content li {
  font-size: 0.93rem;
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

/* === 404 === */
.page-404 { text-align: center; padding: 4rem 0; }
.page-404 h1 { font-size: 5rem; font-weight: 800; color: var(--color-border); }
.page-404 p { color: var(--color-text-muted); font-size: 1.1rem; }

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--color-text-muted);
}

.empty-state p {
  font-size: 1.15rem;
  margin: 0;
}

/* === Dashboard Widgets (Hero) === */
.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.dash-widget {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
}

/* Date & Time */
.dash-date-day {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

.dash-date-time {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1.1;
  margin: var(--space-xs) 0;
}

.dash-holiday {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.55);
  margin-top: var(--space-sm);
}

.dash-holiday i { color: #fbbf24; margin-right: var(--space-xs); }
.dash-holiday strong { color: #fbbf24; }

/* Weather */
.dash-weather-main {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.dash-weather-icon { font-size: 2rem; color: #fbbf24; }
.dash-weather-temp { font-size: var(--font-size-2xl); font-weight: 800; color: #fff; }
.dash-weather-desc { font-size: var(--font-size-base); color: rgba(255,255,255,0.65); text-transform: capitalize; }

.dash-weather-details {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.5);
  margin-top: var(--space-xs);
}

.dash-weather-city {
  margin-top: var(--space-sm);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.dash-city-link {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.dash-city-link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.dash-city-link.active { color: #fff; background: rgba(255,255,255,0.15); font-weight: 600; }

.dash-weather-unavailable {
  color: rgba(255,255,255,0.4);
  font-size: var(--font-size-sm);
  padding: var(--space-md) 0;
}

/* Currency Rates Bar */
.dash-rates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  justify-content: center;
}

.dash-rate-item {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-fast);
}

a.dash-rate-item:hover {
  background: rgba(255,255,255,0.12);
  color: inherit;
}

.dash-rate-flag {
  font-size: var(--font-size-base);
  color: rgba(255,255,255,0.5);
  width: 18px;
  text-align: center;
}

.dash-rate-code {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.6);
}

.dash-rate-value {
  font-weight: 700;
  font-size: var(--font-size-base);
  color: #fff;
}

.dash-rate-change {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: rgba(255,255,255,0.4);
}

.dash-rate-change.up { color: #4ade80; }
.dash-rate-change.down { color: #f87171; }
.dash-rate-crypto .dash-rate-code { color: #fbbf24; }
.dash-rate-metal .dash-rate-code { color: #f59e0b; }
.dash-rate-metal .dash-rate-flag { color: #f59e0b; }

.dash-rate-sub {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}

/* Dashboard Search */
.dash-search {
  max-width: 600px;
  margin: 0 auto;
}

.dash-search-box {
  position: relative;
}

.dash-search-box > .bi-search {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8b95a5;
  font-size: 1rem;
  z-index: 1;
  pointer-events: none;
}

.dash-search-box input {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 0.8rem 5.5rem 0.8rem 2.8rem;
  font-size: 1rem;
  background: rgba(255,255,255,0.08);
  color: #fff;
  transition: all var(--transition-normal);
  width: 100%;
}

.dash-search-box input::placeholder { color: #8b95a5; }

.dash-search-box input:focus {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
  color: #fff;
  outline: none;
}

.dash-search-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 3px;
}

.dash-search-btn {
  width: 34px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.dash-search-btn i {
  font-size: 14px;
  color: rgba(255,255,255,0.35);
  transition: color var(--transition-fast);
}

.dash-search-btn:hover i { color: rgba(255,255,255,0.7); }
.dash-search-btn.active i { color: #fff; }

.dash-search-btn:hover { background: rgba(255,255,255,0.08); }
.dash-search-btn.active { background: rgba(255,255,255,0.18); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

/* Quick Panel (Notes & Bookmarks) */
.qp {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.qp-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.qp-bar:hover { background: var(--color-bg); }

.qp-chip {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.qp-chip .bi { font-size: 0.8rem; }

.qp-count {
  background: var(--color-bg);
  border-radius: 10px;
  padding: 0 0.4rem;
  font-size: 0.7rem;
  min-width: 1.2rem;
  text-align: center;
}

.qp-count:empty { display: none; }

.qp-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  transition: transform var(--transition-normal);
}

.qp.open .qp-arrow { transform: rotate(180deg); }

.qp-body {
  border-top: 1px solid var(--color-border);
  padding: 0.6rem 0.9rem 0.9rem;
}

.qp-tabs {
  display: flex;
  gap: 0.15rem;
  margin-bottom: 0.6rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.qp-tab {
  flex: 1;
  padding: 0.3rem 0.5rem;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.qp-tab:hover { color: var(--color-text); }
.qp-tab.active {
  background: var(--color-card);
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.qp-input-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.qp-input-row input {
  font-size: var(--font-size-xs);
  padding: 0.3rem 0.5rem;
}

.qp-input-row input { flex: 1; }

.qp-input-row .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Notes */
.qp-note {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.3rem 0;
  font-size: var(--font-size-xs);
  line-height: 1.4;
  border-bottom: 1px solid var(--color-border);
}

.qp-note:last-child { border-bottom: none; }

.qp-note-check {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.qp-note-check:hover { color: #16a34a; }
.qp-note-check.checked { color: #16a34a; }

.qp-note-text { flex: 1; word-break: break-word; }
.qp-note-text.done { text-decoration: line-through; opacity: 0.4; }

.qp-note-del {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc2626;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: #fff;
  opacity: 0;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-top: 1px;
}

.qp-note:hover .qp-note-del { opacity: 1; }
.qp-note-del:hover { background: #b91c1c; }

/* Bookmarks */
.qp-bm-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.qp-bm {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--transition-fast);
  max-width: 180px;
}

.qp-bm:hover {
  border-color: var(--color-primary, #2563eb);
  color: var(--color-primary, #2563eb);
}

.qp-bm img { width: 14px; height: 14px; border-radius: 2px; }
.qp-bm .bi { font-size: 0.8rem; color: var(--color-text-muted); flex-shrink: 0; }

.qp-bm-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qp-bm-del {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dc2626;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: #fff;
  opacity: 0;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.qp-bm:hover .qp-bm-del { opacity: 1; }
.qp-bm-del:hover { background: #b91c1c; }

.qp-empty {
  text-align: center;
  padding: 0.6rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Tool Filter (inline) */
.dash-tool-filter {
  max-width: 200px;
  font-size: var(--font-size-sm) !important;
}

/* === Print === */
@media print {
  .navbar, footer, .search-box, form, .breadcrumb-wrap, .trust-bar,
  .faq-section, .content-article, .btn-copy, .dash-notes,
  .dash-search, .dash-rates { display: none !important; }
  body { background: #fff; }
  .page-card, .calc-result { border: 1px solid #ddd; box-shadow: none; }
  main { padding: 0; }
}

/* === Responsive === */

/* Tablet */
@media (max-width: 991px) {
  .hero h1 { font-size: 1.8rem; }
  .page-header h1 { font-size: 1.4rem; }
}

/* Mobile landscape / small tablet */
@media (max-width: 768px) {
  .hero { padding: 1.8rem 0 1.3rem; }
  .hero h1 { font-size: var(--font-size-2xl); }
  .page-header h1 { font-size: var(--font-size-xl); }
  .content-article { padding: 1.2rem; }

  .trust-bar .trust-item { font-size: 0.75rem; }
  .trust-bar .trust-item .me-3 { margin-right: 0.5rem !important; }

  /* Dashboard responsive */
  .dash-row { grid-template-columns: 1fr; gap: var(--space-sm); }
  .dash-date-time { font-size: var(--font-size-2xl); }
  .dash-rates { gap: var(--space-xs); }
  .dash-rate-item { padding: var(--space-xs) var(--space-sm); }
}

/* Mobile portrait */
@media (max-width: 576px) {
  .tool-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
  }

  .tool-tile { padding: var(--space-md) 0.4rem; }

  .tool-tile .icon {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
  }

  .tool-tile .name { font-size: 0.78rem; }
  .tool-tile .desc { display: none; }

  .hero { padding: var(--space-lg) 0 var(--space-md); }
  .hero h1 { font-size: 1.4rem; }

  .page-card,
  .calc-result,
  .content-article { padding: var(--space-md); }

  .page-header .badge-update {
    display: block;
    margin: 0.3rem 0 0;
    width: fit-content;
  }

  .trust-bar { overflow-x: auto; white-space: nowrap; }
  .trust-bar .container { white-space: nowrap; }

  /* Stack result metrics */
  .calc-result .row .col-4,
  .calc-result .row .col-6 {
    margin-bottom: var(--space-sm);
  }

  .schedule-wrap { max-height: 300px; }

  .search-box { max-width: 100%; }

  /* Dashboard mobile */
  .dash-widget { padding: var(--space-sm) var(--space-md); }
  .dash-date-time { font-size: var(--font-size-xl); }
  .dash-weather-temp { font-size: var(--font-size-xl); }
  .dash-weather-icon { font-size: 1.5rem; }
  .dash-search-box input { font-size: 0.9rem; padding: 0.7rem 5rem 0.7rem 2.3rem; }
  .dash-tool-filter { max-width: 140px; }
  .dash-rates { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .dash-rate-item { flex-shrink: 0; }
}

/* Very small screens */
@media (max-width: 374px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h1 { font-size: 1.2rem; }
}

/* === Auth Forms === */
.auth-card {
  max-width: 440px;
  margin: 0 auto;
}

.auth-card-wide {
  max-width: 540px;
}

.auth-card .page-card {
  padding: var(--space-lg) var(--space-xl);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.auth-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}
