/* ── CSS Variables ── */
:root {
  --primary:      #5b8ff9;
  --primary-dark: #3a72f5;
  --primary-glow: rgba(91,143,249,.18);
  --success:      #48bb78;
  --warning:      #f6ad55;
  --danger:       #f56565;
  --purple:       #9f7aea;
  --teal:         #38b2ac;
  --sidebar-bg:   #131928;
  --sidebar-hover:#1e2d45;
  --sidebar-text: #c0c8d8;
  --bg:           #f0f2f5;
  --surface:      #ffffff;
  --border:       #e8eaed;
  --text:         #1e2635;
  --muted:        #8896a7;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.07);
  --shadow-md:    0 4px 16px rgba(0,0,0,.09);
  --shadow-lg:    0 20px 60px rgba(0,0,0,.16);
  --transition:   .16s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 14px; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }

/* ── App layout ── */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar-brand {
  padding: 20px 20px 14px;
  font-size: 17px; font-weight: 800; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.07);
  letter-spacing: .5px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #fff;
}
.sidebar-brand span { color: var(--primary); }
.sidebar-user {
  padding: 10px 20px 14px;
  font-size: 11.5px; color: #5a6a80;
  border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { color: #c0c8d8; font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10.5px; color: #5a6a80; text-transform: capitalize; }
.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-section { margin-top: 6px; }
.nav-section-title {
  padding: 10px 20px 4px;
  font-size: 10px; font-weight: 700; color: #3d4f65;
  text-transform: uppercase; letter-spacing: .8px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text); font-size: 13px;
  cursor: pointer; position: relative;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active {
  background: var(--sidebar-hover); color: #fff;
}
.nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--primary); border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--danger);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}
.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.05); }
.btn-logout {
  width: 100%; background: none; border: 1px solid rgba(255,255,255,.1);
  color: #5a6a80; padding: 8px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12.5px; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-logout:hover { background: rgba(255,255,255,.06); color: #c0c8d8; border-color: rgba(255,255,255,.2); }

/* ── Main area ── */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.top-bar {
  height: 54px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px; flex-shrink: 0;
}
.top-bar-title { font-size: 13px; color: var(--muted); flex: 1; }
.top-bar-actions { display: flex; align-items: center; gap: 10px; }
.top-bar-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.page-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ── Page header ── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.page-header-left {}
.page-header h1 { font-size: 22px; font-weight: 700; line-height: 1.2; }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 3px; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ── Buttons ── */
.btn-primary {
  background: var(--primary); color: #fff; border: none;
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: background var(--transition), box-shadow var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px var(--primary-glow); }
.btn-secondary {
  background: var(--surface); color: #444; border: 1px solid var(--border);
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; transition: background var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { background: #f5f6f8; }
.btn-danger {
  background: var(--danger); color: #fff; border: none;
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon {
  background: none; border: 1px solid var(--border); color: var(--muted);
  width: 32px; height: 32px; border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg); color: var(--text); border-color: #bbb; }
.btn-back {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font-size: 13px; padding: 0 0 6px; display: flex; align-items: center; gap: 4px;
}
.btn-back:hover { text-decoration: underline; }

/* ── Cards ── */
.card {
  background: var(--surface); border-radius: var(--radius-md); padding: 20px;
  border: 1px solid var(--border); margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card:last-child { margin-bottom: 0; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title-action { margin-left: auto; }
.card-accent-blue  { border-left: 3px solid var(--primary); }
.card-accent-green { border-left: 3px solid var(--success); }
.card-accent-red   { border-left: 3px solid var(--danger); }
.card-accent-purple{ border-left: 3px solid var(--purple); }
.card-accent-amber  { border-left: 3px solid var(--warning); }
.card-accent-teal   { border-left: 3px solid var(--teal); }
.card-accent-orange { border-left: 3px solid #f97316; }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
.stats-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card {
  border-radius: var(--radius-md); padding: 18px 20px;
  color: #fff; display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; right: -10px; top: -10px;
  width: 70px; height: 70px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11.5px; opacity: .82; font-weight: 500; }
.stat-sub { font-size: 11px; opacity: .65; margin-top: 2px; }
.stat-icon { font-size: 20px; margin-bottom: 2px; }
.stat-blue   { background: linear-gradient(135deg, #5b8ff9, #4070e0); }
.stat-red    { background: linear-gradient(135deg, #f56565, #c53030); }
.stat-green  { background: linear-gradient(135deg, #48bb78, #2f855a); }
.stat-purple { background: linear-gradient(135deg, #9f7aea, #6b46c1); }
.stat-amber  { background: linear-gradient(135deg, #f6ad55, #c05621); }
.stat-teal   { background: linear-gradient(135deg, #38b2ac, #2c7a7b); }
.stat-gray   { background: linear-gradient(135deg, #a0aec0, #718096); }

/* ── Dashboard grid ── */
.dash-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; margin-bottom: 16px; }
.dash-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-span2 { grid-column: span 2; }

/* ── Trend chart (SVG-based) ── */
.trend-chart { width: 100%; overflow: hidden; }
.trend-bars { display: flex; align-items: flex-end; gap: 6px; height: 80px; }
.trend-bar-group { flex: 1; display: flex; gap: 2px; align-items: flex-end; }
.trend-bar {
  flex: 1; border-radius: 3px 3px 0 0;
  min-height: 2px; transition: opacity .2s;
}
.trend-bar:hover { opacity: .8; }
.trend-bar-created { background: var(--primary); }
.trend-bar-resolved { background: var(--success); opacity: .8; }
.trend-labels { display: flex; justify-content: space-between; margin-top: 6px; }
.trend-label { font-size: 10px; color: var(--muted); flex: 1; text-align: center; }
.trend-legend { display: flex; gap: 14px; margin-bottom: 10px; }
.trend-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.trend-legend-dot { width: 8px; height: 8px; border-radius: 2px; }

/* ── Agent workload rows ── */
.workload-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bg); }
.workload-row:last-child { border-bottom: none; }
.workload-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.workload-name { font-size: 13px; font-weight: 500; flex: 1; }
.workload-bar-wrap { width: 100px; }
.workload-bar-track { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.workload-bar-fill { height: 100%; border-radius: 3px; background: var(--primary); }
.workload-count { font-size: 12px; color: var(--muted); min-width: 20px; text-align: right; }

/* ── Contract health bars ── */
.contract-health-row { padding: 10px 0; border-bottom: 1px solid var(--bg); }
.contract-health-row:last-child { border-bottom: none; }
.contract-health-header { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 12.5px; }
.contract-health-company { color: var(--muted); font-size: 11px; }
.contract-health-pct { font-weight: 600; }
.progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }
.progress-ok   { background: var(--success); }
.progress-warn { background: var(--warning); }
.progress-crit { background: var(--danger); }

/* ── Tables ── */
.psa-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.psa-table thead { background: #f7f8fa; position: sticky; top: 0; z-index: 1; }
.psa-table th { padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.psa-table td { padding: 12px 14px; border-bottom: 1px solid #f4f5f7; font-size: 13px; }
.psa-table tr:last-child td { border-bottom: none; }
.psa-table tr.clickable { cursor: pointer; }
.psa-table tr.clickable:hover td { background: #f7f9ff; }
.psa-table-compact td { padding: 9px 14px; }

/* ── Filter / search bar ── */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap input { width: 100%; padding-left: 34px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }

/* ── Form controls ── */
.form-input, .form-select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px;
  background: var(--surface); color: var(--text);
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-input { width: 100%; }
.form-select { min-width: 140px; cursor: pointer; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap;
}
.badge-blue   { background: #ebf4ff; color: #2b6cb0; }
.badge-green  { background: #e6ffed; color: #276749; }
.badge-red    { background: #fff5f5; color: #c53030; }
.badge-orange { background: #fffaf0; color: #c05621; }
.badge-yellow { background: #fffff0; color: #975a16; }
.badge-gray   { background: #f7f8fa; color: #555; }
.badge-purple { background: #faf5ff; color: #553c9a; }
.badge-teal   { background: #e6fffa; color: #2c7a7b; }

/* ── SLA countdown pills ── */
.sla-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.sla-ok     { background: #e6ffed; color: #276749; }
.sla-warn   { background: #fffff0; color: #975a16; }
.sla-crit   { background: #fff5f5; color: #c53030; }
.sla-breach { background: #c53030; color: #fff; }

/* ── Tabs ── */
.tab-bar { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 4px; }
.tab-btn {
  padding: 9px 18px; font-size: 13px; font-weight: 500; color: var(--muted);
  border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color var(--transition), border-color var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count { background: var(--bg); color: var(--muted); font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }
.tab-btn.active .tab-count { background: var(--primary-glow); color: var(--primary); }

/* ── Section ── */
.section { margin-bottom: 24px; }
.section-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.48); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-card { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; min-width: 420px; max-width: 600px; width: 100%; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal-card-wide { max-width: 780px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 18px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Detail layout ── */
.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f4f5f7; font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-row-label { color: var(--muted); font-size: 12px; min-width: 100px; }
.detail-row-value { text-align: right; font-weight: 500; }

/* ── Notes ── */
.notes-list { display: flex; flex-direction: column; gap: 10px; }
.note { padding: 12px 14px; border-radius: var(--radius-sm); background: #f7f9ff; border: 1px solid #e0e8ff; }
.note-internal { background: #fffff8; border-color: #fef3c7; }
.note-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.note-author { font-weight: 600; font-size: 13px; }
.note-time { color: var(--muted); font-size: 11px; margin-left: auto; }
.note-body { font-size: 13px; color: #444; line-height: 1.55; white-space: pre-wrap; }
.note-form { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.note-form-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 13px; }

/* ── Time entries ── */
.time-list { display: flex; flex-direction: column; gap: 6px; }
.time-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f4f5f7; font-size: 13px; }
.time-row:last-child { border-bottom: none; }
.time-hours { font-weight: 700; color: var(--primary); min-width: 36px; }
.time-agent { color: var(--muted); flex: 1; }
.time-desc { flex: 2; color: var(--text); }
.time-form { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; align-items: end; }

/* ── Projects grid ── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px,1fr)); gap: 16px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; cursor: pointer; transition: box-shadow var(--transition), border-color var(--transition); }
.project-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.project-card-header h3 { font-size: 14px; font-weight: 600; flex: 1; margin-right: 8px; line-height: 1.3; }
.project-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.progress { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress-fill-blue { height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s ease; }

/* ── Company card ── */
.company-row-meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; margin-top: 2px; }

/* ── KB articles ── */
.kb-article-row { padding: 14px 0; border-bottom: 1px solid var(--border); }
.kb-article-row:last-child { border-bottom: none; }
.kb-article-title { font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.kb-article-title:hover { color: var(--primary); }
.kb-article-meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 12px; }
.kb-article-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.kb-tag { background: var(--bg); color: var(--muted); padding: 2px 8px; border-radius: 20px; font-size: 10.5px; }

/* ── Timesheet ── */
.timesheet-grid { display: grid; grid-template-columns: 120px repeat(7, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius-md); overflow: hidden; }
.ts-header { background: #f7f8fa; padding: 10px 12px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; text-align: center; }
.ts-cell { background: var(--surface); padding: 8px; min-height: 60px; }
.ts-agent { background: #f7f8fa; padding: 10px 12px; font-size: 13px; font-weight: 500; display: flex; align-items: center; }
.ts-entry { background: var(--primary-glow); border-radius: 4px; padding: 3px 6px; font-size: 11px; color: var(--primary); font-weight: 600; margin-bottom: 3px; cursor: pointer; }
.ts-total { text-align: right; padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--text); background: #f7f8fa; display: flex; align-items: center; justify-content: flex-end; }

/* ── Invoice ── */
.invoice-status-draft     { background: #f7f8fa; color: #555; }
.invoice-status-sent      { background: #ebf4ff; color: #2b6cb0; }
.invoice-status-paid      { background: #e6ffed; color: #276749; }
.invoice-status-overdue   { background: #fff5f5; color: #c53030; }
.invoice-status-void      { background: #f7f8fa; color: #888; text-decoration: line-through; }
.invoice-status-partiallypaid { background: #fffff0; color: #975a16; }

/* ── Asset status ── */
.asset-status-active       { background: #e6ffed; color: #276749; }
.asset-status-instorage    { background: #f7f8fa; color: #555; }
.asset-status-inrepair     { background: #fffff0; color: #975a16; }
.asset-status-decommissioned { background: #fff5f5; color: #888; }

/* ── Login ── */
.empty-layout { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #131928 0%, #1e2d45 100%); }
.login-card { background: var(--surface); border-radius: var(--radius-lg); padding: 44px 40px; width: 380px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo-icon { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--purple)); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 22px; }
.login-logo h2 { font-size: 26px; font-weight: 800; color: var(--text); }
.login-logo h2 span { color: var(--primary); }
.login-logo p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.login-error { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }

/* ── Utilities ── */
.loading { text-align: center; padding: 60px; color: var(--muted); font-size: 15px; }
.loading-splash { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 16px; color: var(--muted); }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; }
.text-muted { color: var(--muted); }
.text-red   { color: #c53030; }
.text-green { color: #276749; }
.text-primary { color: var(--primary); }
.fw-600 { font-weight: 600; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-4 { gap: 4px; }
.ml-auto { margin-left: auto; }
.full-width { width: 100%; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── Skeleton loader ── */
.skeleton { border-radius: 4px; background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 14px; margin-bottom: 10px; }
.skeleton-title { height: 18px; width: 60%; margin-bottom: 14px; }

/* ── Form sections ── */
.form-section-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 10px; margin-top: 4px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}

/* ── Contact row in create form ── */
.contact-row-form {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 10px; background: #f9fafc;
}

/* ── Card hover ── */
.card-hover { transition: box-shadow var(--transition), border-color var(--transition); }
.card-hover:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.text-right { text-align: right; }

/* ── Weekly timesheet view ── */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.week-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; }
.week-day-weekend { opacity: .7; }
.week-day-today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
.week-day-header { padding: 10px 12px; border-bottom: 1px solid var(--bg); background: #f7f8fa; }
.week-day-name { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.week-day-date { font-size: 13px; font-weight: 600; margin-top: 2px; }
.week-day-total { font-size: 11px; color: var(--primary); font-weight: 700; margin-top: 2px; }
.week-day-entries { padding: 8px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.time-entry { border-radius: var(--radius-sm); padding: 5px 7px; font-size: 11px; }
.time-entry-billable { background: var(--primary-glow); border: 1px solid #c7d8ff; }
.time-entry-nonbillable { background: #f7f8fa; border: 1px solid var(--border); }
.time-entry-hours { font-weight: 700; color: var(--primary); }
.time-entry-ticket { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-entry-desc { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-add-btn { margin-top: auto; width: 100%; background: none; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 5px; font-size: 11px; color: var(--muted); cursor: pointer; }
.time-add-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); }

/* ── Blazor error ── */
#blazor-error-ui { background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* Live check-in pulse dot */
@keyframes checkin-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.75); }
}
.live-dot {
    width: 12px; height: 12px; flex-shrink: 0;
    background: var(--success); border-radius: 50%;
    animation: checkin-pulse 1.4s ease-in-out infinite;
}
