/* ==========================================================================
   Apex Dashboard — Pizzichella Edition (financial refresh)
   SINGLE source of truth for brand styling. Design language: restrained
   fintech (dense data, tabular figures, muted brand colors). Swap the
   token values below to rebrand without touching any template.
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --primary:    #0f2a43;   /* Deep navy — sidebar, headings, primary buttons */
  --secondary:  #2f6fa0;   /* Desaturated sea blue — links, accents */
  --accent:     #b9985f;   /* Muted sand gold — brand highlights */
  --success:    #17825c;   /* Deep green — available, paid, confirmed */
  --warning:    #b9791c;   /* Deep amber — deposit, expiring soon */
  --danger:     #c23d3d;   /* Restrained red — maintenance, overdue */
  --bg:         #f4f6f9;
  --card:       #ffffff;
  --border:     #e3e9f0;
  --text:       #16222e;
  --muted:      #64748b;

  --sidebar-width: 240px;
  --radius: 10px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* --- Base layout ------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { letter-spacing: -0.01em; }

/* --- Sidebar ------------------------------------------------------------ */
.sidebar {
  background: linear-gradient(180deg, #10304d 0%, var(--primary) 45%, #0b2033 100%);
  width: var(--sidebar-width);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar .brand-accent { color: var(--accent); }
.sidebar a {
  color: rgba(255, 255, 255, 0.66);
  border-radius: 7px;
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.sidebar a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: inset 2.5px 0 0 var(--accent);
}

/* --- Topbar -------------------------------------------------------------- */
.topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-weight: 650; }

/* --- Cards & KPI ---------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.kpi-card { position: relative; overflow: hidden; font-variant-numeric: tabular-nums; }
.kpi-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2.5px;
  background: var(--kpi-color, var(--secondary));
}
.text-muted { color: var(--muted); }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  border-radius: 7px;
  font-weight: 600;
  font-size: 13.5px;
  transition: filter 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(1.12); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.btn-outline:hover { filter: none; background: #f8fafc; }
.btn-danger { background: var(--danger); color: #fff; }

/* --- Status badges ---------------------------------------------------------- */
.badge {
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.14rem 0.5rem;
  white-space: nowrap;
}
.badge-success { background: color-mix(in srgb, var(--success) 11%, white); color: var(--success); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 25%, white); }
.badge-warning { background: color-mix(in srgb, var(--warning) 12%, white); color: var(--warning); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 25%, white); }
.badge-danger  { background: color-mix(in srgb, var(--danger) 10%, white);  color: var(--danger);  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 25%, white); }
.badge-info    { background: color-mix(in srgb, var(--secondary) 11%, white); color: var(--secondary); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--secondary) 25%, white); }
.badge-muted   { background: color-mix(in srgb, var(--muted) 10%, white);   color: var(--muted);   box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 25%, white); }
.badge-accent  { background: color-mix(in srgb, var(--accent) 14%, white);  color: #8a6f3c;        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, white); }

/* Booking channel badges — solid, used as compact identifiers */
.badge-channel-diretto   { background: var(--primary); color: #fff; }
.badge-channel-gyg       { background: #d84a2b; color: #fff; }
.badge-channel-viator    { background: #2c7a54; color: #fff; }
.badge-channel-sito      { background: var(--secondary); color: #fff; }
.badge-channel-telefono  { background: var(--accent); color: #fff; }

/* --- Tables ------------------------------------------------------------------ */
.data-table { font-variant-numeric: tabular-nums; }
.data-table th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.data-table tr { border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, white); }
.data-table tbody tr:last-child { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fafc; }

/* --- Forms --------------------------------------------------------------------- */
.form-input {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card);
  font-size: 13.5px;
  box-shadow: var(--shadow-card);
}
.form-input:focus {
  outline: 2px solid color-mix(in srgb, var(--secondary) 30%, transparent);
  outline-offset: 0;
  border-color: var(--secondary);
}

/* --- Toast ----------------------------------------------------------------------- */
.toast { border-left: 3px solid var(--secondary); }
.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-danger  { border-left-color: var(--danger); }
