/* ============================================================
   EV Charge Manager — Global Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #090c14;
  --surface:     #0f1422;
  --surface2:    #151a2d;
  --surface3:    #1c2236;
  --border:      #212843;
  --border2:     #2a3356;
  --accent:      #4f8ef7;
  --accent-dim:  rgba(79,142,247,.12);
  --accent-hover:#3d7de0;
  --green:       #34d399;
  --green-dim:   rgba(52,211,153,.12);
  --amber:       #f59e0b;
  --amber-dim:   rgba(245,158,11,.12);
  --red:         #f87171;
  --red-dim:     rgba(248,113,113,.12);
  --purple:      #a78bfa;
  --purple-dim:  rgba(167,139,250,.12);
  --text:        #dde2f2;
  --text-muted:  #5e6794;
  --text-mid:    #9099be;
  --radius:      10px;
  --radius-lg:   14px;
  --shadow:      0 4px 32px rgba(0,0,0,.5);
  --transition:  .18s ease;
}

html { font-size: 14px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Typography helpers ─────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--green); }
.text-amber  { color: var(--amber); }
.text-red    { color: var(--red); }
.mono        { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: .8rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition), background var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover  { opacity: .85; }
.btn:active { opacity: .7; }

.btn-primary { background: var(--accent);   color: #fff; }
.btn-danger  { background: var(--red);      color: #fff; }
.btn-success { background: var(--green);    color: #0a1a12; }
.btn-ghost {
  background: var(--surface2);
  color: var(--text-mid);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface3); color: var(--text); opacity: 1; }
.btn-sm { padding: .35rem .75rem; font-size: .78rem; }
.btn-icon {
  padding: .45rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--surface3); color: var(--text); }
.btn-icon svg { display: block; }

/* ── Forms ──────────────────────────────────────────────────── */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .35rem;
}
.input, select.input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .55rem .85rem;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-muted); }

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Alert / toast ──────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-bottom: 1rem;
}
.alert-success { background: var(--green-dim);  color: var(--green); border: 1px solid rgba(52,211,153,.25); }
.alert-error   { background: var(--red-dim);    color: var(--red);   border: 1px solid rgba(248,113,113,.25); }
.alert-info    { background: var(--accent-dim); color: var(--accent);border: 1px solid rgba(79,142,247,.25); }

/* ── Toast notification ─────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: .7rem 1.1rem;
  font-size: .85rem;
  box-shadow: var(--shadow);
  animation: slideIn .2s ease;
  pointer-events: all;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--green); color: var(--green); }
.toast.error   { border-left: 3px solid var(--red);   color: var(--red); }
.toast.info    { border-left: 3px solid var(--accent); color: var(--accent); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .15s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  animation: scaleIn .18s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-body  { padding: 1.25rem 1.5rem; }
.modal-footer {
  padding: 0 1.5rem 1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Popover ────────────────────────────────────────────────── */
.popover {
  position: fixed;
  z-index: 400;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .5rem;
  min-width: 180px;
  max-width: 240px;
  animation: scaleIn .15s ease;
}
.popover.hidden { display: none; }
.popover-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .82rem;
  transition: background var(--transition);
}
.popover-item:hover { background: var(--surface3); }
.popover-item.checked { background: var(--accent-dim); }
.popover-item .check-icon { margin-left: auto; color: var(--accent); }
.popover-divider { border-top: 1px solid var(--border); margin: .4rem 0; }
.popover-new-tag {
  display: flex;
  gap: .4rem;
  padding: .3rem .4rem 0;
}
.popover-new-tag .input { font-size: .78rem; padding: .3rem .5rem; }

/* ════════════════════════════════════════════════════════════
   NAVBAR
   ════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo svg { color: var(--accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: 1.5rem;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .75rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover  { background: var(--surface2); color: var(--text); }
.nav-link.active { background: var(--accent-dim); color: var(--accent); }
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.nav-user {
  font-size: .82rem;
  color: var(--text-muted);
  padding: .3rem .6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .4rem;
}
.nav-mobile {
  display: none;
  position: fixed;
  top: 58px;
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 199;
  padding: .75rem 1rem;
  flex-direction: column;
  gap: .3rem;
}
.nav-mobile.open { display: flex; }
.nav-mobile .nav-link { width: 100%; }

/* ════════════════════════════════════════════════════════════
   PAGE LAYOUT
   ════════════════════════════════════════════════════════════ */
.page { padding: 1.5rem; max-width: 1440px; margin: 0 auto; }

/* ── Page header ───────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.page-title { font-size: 1.3rem; font-weight: 700; }
.page-subtitle { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }

/* ── Filters bar ───────────────────────────────────────────── */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .45rem .85rem;
  border-radius: var(--radius);
  font-size: .82rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  padding-right: 1.8rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235e6794' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--accent); }
.filter-select option { background: var(--surface2); }

.search-wrap { position: relative; }
.search-icon {
  position: absolute;
  left: .65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .45rem .75rem .45rem 2rem;
  font-size: .82rem;
  font-family: inherit;
  width: 180px;
  outline: none;
  transition: border-color var(--transition), width .2s ease;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); width: 220px; }

/* ── Stat cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.stat-card.blue::after   { background: linear-gradient(90deg, var(--accent), transparent); }
.stat-card.green::after  { background: linear-gradient(90deg, var(--green),  transparent); }
.stat-card.amber::after  { background: linear-gradient(90deg, var(--amber),  transparent); }
.stat-card.purple::after { background: linear-gradient(90deg, var(--purple), transparent); }

.stat-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .85rem;
  font-size: .9rem;
}
.stat-card.blue   .stat-icon { background: var(--accent-dim);  color: var(--accent); }
.stat-card.green  .stat-icon { background: var(--green-dim);   color: var(--green); }
.stat-card.amber  .stat-icon { background: var(--amber-dim);   color: var(--amber); }
.stat-card.purple .stat-icon { background: var(--purple-dim);  color: var(--purple); }

.stat-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: .3rem;
  transition: color .2s;
}
.stat-card.blue   .stat-value { color: var(--accent); }
.stat-card.green  .stat-value { color: var(--green); }
.stat-card.amber  .stat-value { color: var(--amber); }
.stat-card.purple .stat-value { color: var(--purple); }
.stat-sub { font-size: .77rem; color: var(--text-muted); }

/* ── Charts grid ───────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
}
.chart-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}
.chart-wrap { position: relative; height: 200px; }

/* ── Table card ────────────────────────────────────────────── */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: .75rem;
}
.table-title { font-size: .9rem; font-weight: 700; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }

thead { background: var(--surface2); }
th {
  padding: .65rem 1rem;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
}
th:hover { color: var(--text); }
th.sorted { color: var(--accent); }
th .sort-arrow { margin-left: .25rem; opacity: .4; font-size: .7rem; }
th.sorted .sort-arrow { opacity: 1; }

tbody tr { border-top: 1px solid var(--border); transition: background var(--transition); }
tbody tr:hover { background: var(--surface2); }
td { padding: .6rem 1rem; white-space: nowrap; vertical-align: middle; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: .5rem;
}
.table-info { font-size: .78rem; color: var(--text-muted); }

/* Pagination */
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; }
.page-btn {
  min-width: 28px; height: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-mid);
  font-size: .78rem;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0 .4rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.page-btn:hover { background: var(--surface3); color: var(--text); border-color: var(--border2); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: .35; cursor: default; }

/* Tags in table */
.tag-cell { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.tag-add-btn {
  width: 20px; height: 20px;
  border-radius: 99px;
  background: var(--surface3);
  border: 1px dashed var(--border2);
  color: var(--text-muted);
  font-size: .85rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.tag-add-btn:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* ════════════════════════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(79,142,247,.08) 0%, transparent 60%), var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.login-logo svg { color: var(--accent); }
.login-title { font-size: 1.25rem; font-weight: 700; margin-bottom: .35rem; text-align: center; }
.login-subtitle { font-size: .82rem; color: var(--text-muted); text-align: center; margin-bottom: 2rem; }
.login-card .btn { width: 100%; justify-content: center; padding: .65rem; font-size: .9rem; }

/* ════════════════════════════════════════════════════════════
   SETTINGS PAGE
   ════════════════════════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.settings-card-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  font-weight: 700;
}
.settings-card-body { padding: 1.25rem 1.4rem; }

.tags-list { display: flex; flex-direction: column; gap: .4rem; }
.tag-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.tag-color-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tag-row-name { flex: 1; font-size: .85rem; }
.tag-row-actions { display: flex; gap: .3rem; }

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .4rem;
}
.color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition), transform var(--transition);
}
.color-swatch:hover  { transform: scale(1.15); }
.color-swatch.active { border-color: #fff; }

.charger-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: .4rem;
}
.charger-uuid { font-size: .72rem; color: var(--text-muted); font-family: monospace; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .charts-grid   { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  html { font-size: 13px; }
  .page { padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .stat-value { font-size: 1.5rem; }
  .nav-links, .nav-right .nav-user, .nav-right .btn-ghost { display: none; }
  .nav-hamburger { display: flex; }
  .filters-bar { gap: .4rem; }
  /* Search full-width on mobile */
  .search-wrap-full { width: 100%; margin-left: 0 !important; }
  .search-wrap-full .search-input { width: 100% !important; }
  /* Charts: prevent overflow */
  .chart-wrap { height: 160px; overflow: hidden; }
  .charts-grid { gap: .75rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 2rem 1.25rem; }
}

/* ── Upload drop zone ──────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.drop-zone:hover, .drop-zone.drag {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.drop-zone svg { color: var(--accent); margin-bottom: .75rem; }
.drop-zone p { font-size: .85rem; color: var(--text-muted); margin-top: .3rem; }

/* ════════════════════════════════════════════════════════════
   ACTIVITY CALENDAR
   ════════════════════════════════════════════════════════════ */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1.25rem;
}
.cal-month { min-width: 0; }
.cal-month-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}
.cal-dow {
  font-size: .6rem;
  text-align: center;
  color: var(--text-muted);
  padding-bottom: 2px;
}
.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--surface2);
  cursor: default;
  position: relative;
  transition: transform .12s, box-shadow .12s;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day-num {
  font-size: .62rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1;
  pointer-events: none;
}
.cal-cell.has-data {
  cursor: pointer;
}
.cal-cell.has-data .cal-day-num {
  color: rgba(255,255,255,.85);
  font-weight: 700;
}
.cal-cell.has-data:hover {
  transform: scale(1.3);
  z-index: 10;
  box-shadow: 0 3px 10px rgba(0,0,0,.5);
}
.cal-cell.empty {
  background: transparent;
  cursor: default;
}
.cal-cell.today {
  outline: 1.5px solid rgba(255,255,255,.4);
  outline-offset: -1px;
}

/* Floating tooltip */
.cal-tooltip {
  position: fixed;
  z-index: 1000;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: .6rem .85rem;
  font-size: .78rem;
  box-shadow: var(--shadow);
  pointer-events: none;
  max-width: 200px;
  line-height: 1.6;
}
.cal-tooltip.hidden { display: none; }
.cal-tooltip-date {
  font-weight: 700;
  color: var(--text);
  margin-bottom: .25rem;
  font-size: .8rem;
}
.cal-tooltip-row { color: var(--text-muted); }
.cal-tooltip-row span { color: var(--text); font-weight: 600; }

@media (max-width: 480px)  { .cal-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; } }

/* ── Chart canvas overflow fix ─────────────────────────────── */
.chart-wrap canvas { max-width: 100%; }

/* ── Search wrap full-width utility ────────────────────────── */
@media (min-width: 701px) {
  .search-wrap-full { margin-left: auto; }
}
