/* ==========================================================================
   STERK CRM — Desktop-first dark theme
   ========================================================================== */

/* --- CSS Variables --- */
:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --border: #30363d;
  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --accent: #4ecdc4;
  --green: #27ae60;
  --red: #e74c3c;
  --orange: #e67e22;
  --yellow: #ffd93d;
  --purple: #9b59b6;
  --blue: #3498db;
  --font: 'Outfit', -apple-system, sans-serif;
  --sidebar-width: 240px;
}

/* ==========================================================================
   1. Reset + Base
   ========================================================================== */

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

html { overflow: hidden; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100%;
  margin: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==========================================================================
   2. Login Overlay
   ========================================================================== */

.login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f7f5;
  z-index: 200;
}

.login-card {
  width: 100%;
  max-width: 320px;
  background: transparent;
  padding: 0;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
}
.sterk-svg-logo {
  height: 32px;
  width: auto;
}
.sterk-svg-logo path {
  fill: #1a1a1a;
}
.login-logo .sterk-svg-logo {
  height: 44px;
}
.login-logo-crm {
  font-size: 13px;
  font-weight: 500;
  color: #888;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-card input {
  width: 100%;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid #d0d0d0;
  border-radius: 0;
  color: #1a1a1a;
  font-size: 14px;
  font-family: var(--font);
  font-weight: 300;
  outline: none;
  transition: border-color 0.3s;
}
.login-card input:focus {
  border-bottom-color: #1a1a1a;
}
.login-card input::placeholder {
  color: #aaa;
  font-weight: 300;
}

.login-card button {
  width: 100%;
  height: 44px;
  background: transparent;
  color: #1a1a1a;
  font-weight: 400;
  font-size: 12px;
  font-family: var(--font);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  border: 1px solid #1a1a1a;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 16px;
}
.login-card button:hover {
  background: #1a1a1a;
  color: #ffffff;
}

.login-error {
  color: #c0392b;
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}

/* ==========================================================================
   3. App Layout
   ========================================================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
  background: #f7f7f5;
  color: #1a1a1a;
}

/* ==========================================================================
   4. Sidebar
   ========================================================================== */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 28px 20px 24px;
}
.sidebar-logo .sterk-svg-logo {
  height: 22px;
  width: auto;
}
.sidebar-logo .sterk-svg-logo path {
  fill: #1a1a1a;
}
.sidebar-logo .login-logo-crm {
  font-size: 11px;
  font-weight: 400;
  color: #999;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.sidebar-user {
  padding: 0 20px 20px;
  font-size: 11px;
  color: #999;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 8px;
}
.user-name {
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 2px;
}
.user-role {
  color: #999;
  font-size: 11px;
  font-weight: 300;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 12px;
}

.nav-item {
  display: block;
  padding: 10px 12px;
  border-radius: 0;
  color: #888;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: color 0.2s;
  border-left: 2px solid transparent;
  cursor: pointer;
}
.nav-item:hover {
  color: #1a1a1a;
  text-decoration: none;
  background: transparent;
}
.nav-item.active {
  border-left-color: #1a1a1a;
  color: #1a1a1a;
  font-weight: 500;
  background: transparent;
}

.nav-icon {
  display: inline-block;
  width: 20px;
  text-align: center;
  margin-right: 10px;
  font-size: 12px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid #f0f0f0;
}

.logout-btn {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 11px;
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s;
}
.logout-btn:hover {
  color: #1a1a1a;
}

/* ==========================================================================
   5. Content Area
   ========================================================================== */

.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  height: 100vh;
  background: #f7f7f5;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}
.content::-webkit-scrollbar, .modal-card::-webkit-scrollbar, .detail-panel::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track, .modal-card::-webkit-scrollbar-track, .detail-panel::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb, .modal-card::-webkit-scrollbar-thumb, .detail-panel::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
.content::-webkit-scrollbar-thumb:hover, .modal-card::-webkit-scrollbar-thumb:hover, .detail-panel::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ==========================================================================
   6. Toolbar
   ========================================================================== */

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 0 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e8e8e8;
}

.toolbar-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #1a1a1a;
}

.toolbar-badge {
  display: inline-block;
  background: transparent;
  color: #999;
  font-size: 12px;
  font-weight: 400;
}

.toolbar-spacer {
  flex: 1;
}

/* ==========================================================================
   7. Period Toggle
   ========================================================================== */

.period-toggle {
  display: flex;
  gap: 0;
}

.period-btn {
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 400;
  font-family: var(--font);
  letter-spacing: 0.5px;
  background: transparent;
  border: 1px solid #d0d0d0;
  border-right: none;
  color: #999;
  cursor: pointer;
  transition: all 0.2s;
}
.period-btn:first-child { border-radius: 0; }
.period-btn:last-child { border-right: 1px solid #d0d0d0; }
.period-btn:hover {
  color: #1a1a1a;
}
.period-btn.active {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #1a1a1a;
  font-weight: 500;
}

/* ==========================================================================
   8. KPI Cards
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #ffffff;
  padding: 24px;
  border: none;
  border-radius: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #999;
  margin-bottom: 12px;
  font-weight: 400;
}

.kpi-value {
  font-size: 32px;
  font-weight: 300;
  line-height: 1.1;
  color: #1a1a1a;
}

.kpi-trend {
  font-size: 11px;
  margin-top: 8px;
  font-weight: 400;
}
.kpi-trend.up {
  color: #2d8a6e;
}
.kpi-trend.down {
  color: #c0392b;
}

.kpi-sublabel {
  font-size: 11px;
  color: #aaa;
  margin-top: 6px;
  font-weight: 300;
}

/* ==========================================================================
   9. Data Tables
   ========================================================================== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.data-table thead tr {
  border-bottom: 1px solid #e8e8e8;
}

.data-table th {
  padding: 12px 16px;
  color: #999;
  font-weight: 400;
  font-size: 10px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.data-table th:hover {
  color: #1a1a1a;
}

.data-table th .sort-arrow {
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.4;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  font-weight: 300;
  color: #333;
}

.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr:hover {
  background: #fafaf8;
}

.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: #999;
  font-size: 12px;
}

.pagination-btn {
  padding: 4px 12px;
  background: transparent;
  border: 1px solid #d0d0d0;
  border-radius: 0;
  color: #666;
  font-size: 11px;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}
.pagination-btn:hover {
  background: #1a1a1a;
  color: #fff;
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   10. Filter Bar
   ========================================================================== */

/* ── Booking Calendar ─────────────────────────────────── */
.cal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 20px;
}
.cal-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.cal-tab:hover { color: #666; }
.cal-tab.active {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
}

.cal-layout {
  display: flex;
  gap: 24px;
}
.cal-main {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.cal-sidebar {
  flex: 0 0 220px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.cal-nav-btn {
  background: transparent;
  border: 1px solid #e0e0e0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #666;
}
.cal-nav-btn:hover { border-color: #1a1a1a; color: #1a1a1a; }
.cal-nav-today {
  background: #1a1a1a;
  color: #fff;
  border: none;
  padding: 6px 14px;
  font-size: 11px;
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
}
.cal-nav-label {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  min-width: 180px;
}

/* Calendar grid */
.cal-grid {
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  overflow: hidden;
}
.cal-grid-header {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
  background: #fafafa;
}
.cal-grid-header .cal-room-label {
  flex: 0 0 140px;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
  border-right: 1px solid #e8e8e8;
}
.cal-grid-header .cal-time-slot {
  flex: 1;
  min-width: 60px;
  padding: 6px 4px;
  font-size: 10px;
  color: #999;
  text-align: center;
  border-right: 1px solid #f0f0f0;
}
.cal-grid-header .cal-time-slot.hour-mark {
  border-right-color: #e0e0e0;
  font-weight: 500;
  color: #666;
}

.cal-grid-row {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
  min-height: 48px;
}
.cal-grid-row:last-child { border-bottom: none; }

.cal-room-label {
  flex: 0 0 140px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #1a1a1a;
  border-right: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
}
.cal-room-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-slot {
  flex: 1;
  min-width: 60px;
  border-right: 1px solid #f5f5f5;
  padding: 4px 2px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.cal-slot.hour-mark {
  border-right-color: #e8e8e8;
}
.cal-slot:hover {
  background: #f8f8f8;
}
.cal-slot.slot-available {
  background: repeating-linear-gradient(
    45deg, transparent, transparent 3px, #f0f0f0 3px, #f0f0f0 4px
  );
}
.cal-slot.slot-available:hover {
  background: #e8f5e9;
}

/* Booking card in slot */
.cal-booking {
  background: var(--slot-bg, #f0f0f0);
  border-left: 3px solid var(--slot-color, #888);
  padding: 4px 6px;
  border-radius: 2px;
  font-size: 10px;
  line-height: 1.3;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
}
.cal-booking:hover {
  opacity: 0.85;
}
.cal-booking-time {
  font-weight: 600;
  color: var(--slot-color, #888);
}
.cal-booking-name {
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar */
.cal-sidebar-section {
  margin-bottom: 20px;
}
.cal-sidebar-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 10px;
}

/* Mini calendar */
.cal-mini table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cal-mini th {
  padding: 4px;
  font-weight: 400;
  color: #999;
  text-align: center;
  font-size: 10px;
}
.cal-mini td {
  padding: 4px;
  text-align: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s;
}
.cal-mini td:hover { background: #f0f0f0; }
.cal-mini td.today {
  background: #1a1a1a;
  color: #fff;
  font-weight: 600;
}
.cal-mini td.selected {
  background: #e8f5e9;
  color: #059669;
  font-weight: 600;
}
.cal-mini td.other-month { color: #ccc; }
.mini-dots {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 2px;
  min-height: 4px;
}
.cal-mini-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.cal-mini-nav span {
  font-size: 13px;
  font-weight: 500;
}
.cal-mini-nav button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  padding: 4px 8px;
}

/* Center filter in sidebar */
.cal-center-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  color: #555;
  cursor: pointer;
}
.cal-center-item input { margin: 0; }

/* Summary card */
.cal-summary-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}
.cal-summary-stat:last-child { border-bottom: none; }
.cal-summary-val { font-weight: 600; }

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  margin-bottom: 20px;
  align-items: center;
}
.filter-search-wrap {
  flex: 0 0 240px;
}
.filter-search {
  width: 100%;
  box-sizing: border-box;
}
.filter-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}
.filter-reset {
  margin-left: 4px;
}
.filter-reset-btn {
  background: transparent;
  border: 1px solid #d0d0d0;
  padding: 6px 14px;
  color: #888;
  font-size: 11px;
  font-family: var(--font);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-reset-btn:hover {
  color: #1a1a1a;
  border-color: #1a1a1a;
}

.filter-dropdown {
  position: relative;
}

.filter-btn {
  background: transparent;
  border: 1px solid #d0d0d0;
  border-radius: 0;
  padding: 6px 14px;
  color: #888;
  font-size: 11px;
  font-family: var(--font);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover {
  color: #1a1a1a;
  border-color: #1a1a1a;
}
.filter-btn.active {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.filter-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  z-index: 10;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  color: #555;
  transition: background 0.1s;
}
.filter-option:hover {
  background: #f7f7f5;
}

.filter-search {
  background: transparent;
  border: 1px solid #d0d0d0;
  border-radius: 0;
  padding: 6px 14px;
  color: #1a1a1a;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 300;
  min-width: 200px;
  outline: none;
  transition: border-color 0.2s;
}
.filter-search:focus {
  border-color: #1a1a1a;
}
.filter-search::placeholder {
  color: #aaa;
}

/* ==========================================================================
   11. Status Badges
   ========================================================================== */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* ==========================================================================
   12. Tags
   ========================================================================== */

.tag {
  display: inline-block;
  background: #f0f0ee;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 10px;
  margin: 2px;
  color: #666;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   13. Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 400;
  font-family: var(--font);
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid #1a1a1a;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #1a1a1a;
}
.btn-primary:hover {
  background: #333;
}

.btn-secondary {
  background: transparent;
  color: #1a1a1a;
  border-color: #d0d0d0;
}
.btn-secondary:hover {
  border-color: #1a1a1a;
}

.btn-danger {
  background: transparent;
  color: #c0392b;
  border-color: #c0392b;
}
.btn-danger:hover {
  background: #c0392b;
  color: #fff;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 10px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
}

/* ==========================================================================
   14. Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: #ffffff;
  border-radius: 0;
  border: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  max-height: 80vh;
  overflow-y: auto;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.modal-sm { max-width: 400px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 900px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid #f0f0f0;
}
.modal-header h3 {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
}

.modal-body {
  padding: 24px 32px;
}

.modal-footer {
  padding: 20px 32px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================================================
   15. Forms
   ========================================================================== */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  color: #888;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #d0d0d0;
  border-radius: 0;
  padding: 8px 0;
  color: #1a1a1a;
  font-size: 14px;
  font-family: var(--font);
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-bottom-color: #1a1a1a;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-select {
  appearance: none;
  cursor: pointer;
}

/* ==========================================================================
   16. Detail Panel
   ========================================================================== */

.detail-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 480px;
  background: #ffffff;
  border-left: 1px solid #e8e8e8;
  z-index: 50;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 16px rgba(0,0,0,0.06);
}
.detail-panel.open {
  transform: translateX(0);
}

.detail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid #f0f0f0;
}

.detail-panel-body {
  padding: 24px;
}

/* ==========================================================================
   17. Timeline
   ========================================================================== */

.timeline {
  border-left: 1px solid #d0d0d0;
  padding-left: 16px;
  margin-left: 8px;
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
}

.timeline-dot {
  position: absolute;
  left: -22px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a1a1a;
}

.timeline-time {
  font-size: 10px;
  color: #aaa;
  letter-spacing: 0.5px;
}

.timeline-content {
  font-size: 13px;
  margin-top: 2px;
}

/* ==========================================================================
   18. Calendar Grid
   ========================================================================== */

.calendar-grid {
  display: grid;
  grid-template-columns: 60px repeat(5, 1fr);
  background: #ffffff;
}

.calendar-header {
  background: #ffffff;
  padding: 12px 8px;
  text-align: center;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999;
  border-bottom: 1px solid #e8e8e8;
}

.calendar-time {
  padding: 8px;
  font-size: 10px;
  color: #aaa;
  border-right: 1px solid #f0f0f0;
  text-align: right;
  font-weight: 300;
}

.calendar-cell {
  padding: 4px;
  border-bottom: 1px solid #f0f0f0;
  border-right: 1px solid #f0f0f0;
  min-height: 48px;
}

.calendar-event {
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  margin-bottom: 2px;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   19. Funnel
   ========================================================================== */

.funnel-step {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}

.funnel-bar {
  background: #f0f0ee;
  border-radius: 0;
  height: 36px;
  overflow: hidden;
  width: 100%;
  position: relative;
}

.funnel-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 0;
  background: #1a1a1a;
  transition: width 0.4s ease;
}

.funnel-label {
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.funnel-value {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 400;
  color: #999;
}

/* ==========================================================================
   20. Toast
   ========================================================================== */

.crm-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a1a1a;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.3px;
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.crm-toast.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   21. Tabs
   ========================================================================== */

.tabs {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 24px;
  gap: 0;
}

.tab {
  padding: 12px 24px;
  cursor: pointer;
  color: #999;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tab:hover {
  color: #1a1a1a;
}
.tab.active {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
}

/* ==========================================================================
   22. Error View
   ========================================================================== */

.error-view {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.error-view h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.error-view p {
  font-size: 14px;
}

/* ==========================================================================
   23. Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .sidebar {
    width: 60px;
    overflow: hidden;
  }
  .sidebar-logo,
  .sidebar-user {
    display: none;
  }
  .nav-item {
    text-align: center;
    padding: 12px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  .nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
  .nav-icon {
    margin-right: 0;
  }
  .nav-item span:not(.nav-icon) {
    display: none;
  }
  .logout-btn span {
    display: none;
  }
  .content {
    margin-left: 60px;
  }
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .detail-panel {
    width: 100%;
  }
  .calendar-grid {
    grid-template-columns: 60px repeat(5, 1fr);
  }
}

/* ==========================================================================
   Finance Module — Equinox light overrides
   ========================================================================== */

/* Finance KPI grid: 4 cols for admin, 3 for practitioner */
#finance-kpis {
  grid-template-columns: repeat(4, 1fr);
}
#finance-kpis.practitioner-kpis {
  grid-template-columns: repeat(3, 1fr);
}

/* Finance filter selects */
#finance-filters .filter-select {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 2px;
  padding: 6px 14px;
  font-size: 11px;
  color: #999;
  letter-spacing: 0.5px;
  font-family: var(--font);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
#finance-filters .filter-select:focus {
  outline: none;
  border-color: #1a1a1a;
  color: #1a1a1a;
}

/* Finance prognose + chart containers on white bg */
#finance-chart,
#finance-prognose {
  border-radius: 2px;
}
