/* ===== DESIGN TOKENS: LIGHT (default) ===== */
:root {
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Display', 'Segoe UI', sans-serif;
  --font-size: 14px;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --sidebar-w: 200px;
  --navbar-h: 48px;
  --transition: 140ms ease;

  --bg:                #f1f4ef;
  --surface:           #ffffff;
  --sidebar-bg:        #0e1f17;
  --sidebar-text:      #aabfb1;
  --sidebar-text-hover:#dde7df;
  --sidebar-hover:     rgba(148, 184, 163, 0.08);
  --sidebar-divider:   #4e6b58;
  --navbar-bg:         #0e1f17;
  --border:            #dde4dc;
  --border-strong:     #c2cdc1;
  --border-focus:      #1b5e3f;
  --text:              #0d1a13;
  --text-muted:        #5a6e63;
  --accent:            #1b5e3f;
  --accent-hover:      #134a30;
  --accent-fg:         #ffffff;
  --danger:            #c0392b;
  --danger-hover:      #a32d22;
  --danger-fg:         #ffffff;
  --success:           #2d8a5f;
  --warning:           #d68910;
  --stripe:            rgba(0, 0, 0, 0.022);
  --hover-row:         rgba(27, 94, 63, 0.05);
  --shadow:            0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
}

/* ===== DARK MODE: OS preference ===== */
@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) {
    --bg:                #0c1410;
    --surface:           #131c17;
    --sidebar-bg:        #060d0a;
    --sidebar-text:      #a0baad;
    --sidebar-text-hover:#dde7df;
    --sidebar-hover:     rgba(148, 184, 163, 0.06);
    --sidebar-divider:   #3e5848;
    --navbar-bg:         #060d0a;
    --border:            #1d2a23;
    --border-strong:     #2d3d33;
    --border-focus:      #4a9b75;
    --text:              #e6ede8;
    --text-muted:        #6a8073;
    --accent:            #4a9b75;
    --accent-hover:      #5cb088;
    --danger:            #e07b6f;
    --danger-hover:      #c0392b;
    --success:           #4abf8a;
    --warning:           #e6b34c;
    --stripe:            rgba(255, 255, 255, 0.022);
    --hover-row:         rgba(74, 155, 117, 0.06);
    --shadow:            0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  }
}

/* ===== DARK MODE: explicit override ===== */
body[data-theme="dark"] {
  --bg:                #0c1410;
  --surface:           #131c17;
  --sidebar-bg:        #060d0a;
  --sidebar-text:      #a0baad;
  --sidebar-text-hover:#dde7df;
  --sidebar-hover:     rgba(148, 184, 163, 0.06);
  --sidebar-divider:   #3e5848;
  --navbar-bg:         #060d0a;
  --border:            #1d2a23;
  --border-strong:     #2d3d33;
  --border-focus:      #4a9b75;
  --text:              #e6ede8;
  --text-muted:        #6a8073;
  --accent:            #4a9b75;
  --accent-hover:      #5cb088;
  --danger:            #e07b6f;
  --danger-hover:      #c0392b;
  --success:           #4abf8a;
  --warning:           #e6b34c;
  --stripe:            rgba(255, 255, 255, 0.022);
  --hover-row:         rgba(74, 155, 117, 0.06);
  --shadow:            0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
}

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

/* ===== BASE ===== */
html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: var(--font-size);
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

/* ===== APP LAYOUT ===== */
.app-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Navbar */
.navbar {
  height: var(--navbar-h);
  background: var(--navbar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #dde7df;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  user-select: none;
}
.navbar-brand img { width: 22px; height: 22px; }
.navbar-brand:hover { color: #fff; text-decoration: none; }

/* App body (sidebar + content) */
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar-nav {
  padding: 0.375rem 0;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.625rem;
  margin: 1px 0.375rem;
  color: var(--sidebar-text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 450;
}
.sidebar-link:hover {
  color: var(--sidebar-text-hover);
  background: var(--sidebar-hover);
  text-decoration: none;
}
.sidebar-link.active {
  color: var(--sidebar-text-hover);
  background: rgba(74, 155, 117, 0.16);
}
.sidebar-link.active:hover {
  background: rgba(74, 155, 117, 0.22);
}
.sidebar-link i {
  font-size: 14px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.sidebar-divider {
  padding: 0.875rem 1rem 0.2rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-divider);
}

/* Main content */
#contents {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg);
}

/* ===== USER MENU (details/summary) ===== */
.user-menu {
  position: relative;
  list-style: none;
}

.user-menu summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.1);
  color: #c2d4c8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  list-style: none;
  transition: background var(--transition), border-color var(--transition);
  user-select: none;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
  color: #dde7df;
}
.user-menu[open] summary {
  background: rgba(255,255,255,0.07);
}
.user-menu-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-tenant {
  opacity: 0.55;
  font-size: 12px;
}
.user-menu-caret {
  opacity: 0.4;
  font-size: 11px;
  transition: transform var(--transition);
  margin-left: 2px;
}
.user-menu[open] .user-menu-caret { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  z-index: 1000;
  overflow: hidden;
  padding: 0.25rem;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.625rem;
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}
.user-dropdown-item:hover {
  background: var(--hover-row);
  text-decoration: none;
  color: var(--text);
}
.user-dropdown-item i { color: var(--text-muted); font-size: 14px; }

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.375rem 0.875rem;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
  user-select: none;
}
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-muted);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--hover-row);
  border-color: var(--border-focus);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-fg);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-outline-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-outline-danger:hover:not(:disabled) {
  background: var(--danger);
  color: var(--danger-fg);
}

.btn-outline-secondary, .btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-muted);
}
.btn-outline-secondary:hover:not(:disabled), .btn-outline:hover:not(:disabled) {
  background: var(--hover-row);
  color: var(--text);
}

.btn-outline-light {
  background: transparent;
  border-color: rgba(255,255,255,0.18);
  color: #c8d8cc;
}
.btn-outline-light:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.btn-link {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  padding-left: 0;
  padding-right: 0;
}
.btn-link:hover:not(:disabled) { color: var(--accent-hover); text-decoration: underline; }

.btn-sm {
  padding: 0.2rem 0.5rem;
  font-size: 12px;
  border-radius: var(--radius-sm);
  gap: 0.25rem;
}

.btn-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  transition: color var(--transition);
  font-family: var(--font);
}
.btn-close:hover { color: var(--text); }

/* ===== LAYOUT GRID (for filter forms) ===== */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.col-auto, .col-md-auto { flex: 0 0 auto; }
.col { flex: 1 1 0; }
.col-3 { flex: 0 0 calc(25% - 0.375rem); }
.col-4 { flex: 0 0 calc(33.333% - 0.333rem); }
.col-6, .col-md-6, .col-sm-6 { flex: 0 0 calc(50% - 0.25rem); }
.col-12, .col-md-12 { flex: 0 0 100%; }
.col-md-3 { flex: 0 0 calc(25% - 0.375rem); }
.col-md-4, .col-lg-4 { flex: 0 0 calc(33.333% - 0.333rem); }
.gy-2 { row-gap: 0.5rem; }
.g-3 { gap: 0.75rem; }
.gx-3 { column-gap: 0.75rem; }

.d-grid { display: grid; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-none { display: none; }

/* ===== TABLES ===== */
.table-responsive-md {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.table th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tfoot td {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.table-hover tbody tr:hover td { background: var(--hover-row); }
.table-striped tbody tr:nth-child(even) td { background: var(--stripe); }

.table-bordered th,
.table-bordered td { border: 1px solid var(--border); }

.table-sm th, .table-sm td { padding: 0.28rem 0.5rem; }
.table-borderless th, .table-borderless td { border: none; }

tr[role="button"] { cursor: pointer; }
tr[role="button"]:hover td { background: var(--hover-row); }

th[role="button"] { cursor: pointer; }
th[role="button"]:hover { color: var(--text); }

/* ===== FORMS ===== */
.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 0.4rem 0.7rem;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(27, 94, 63, 0.12);
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.55; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  padding-right: 2rem;
  cursor: pointer;
}

/* Floating labels */
.form-floating { position: relative; }
.form-floating .form-control {
  height: 3.25rem;
  padding: 1rem 0.75rem 0.25rem;
}
.form-floating label {
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all var(--transition);
  pointer-events: none;
}
.form-floating .form-control:placeholder-shown ~ label {
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.form-floating .form-control:not(:placeholder-shown) ~ label,
.form-floating .form-control:focus ~ label {
  top: 0.5rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* Checkboxes */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.1rem 0;
}
.form-check-input {
  width: 15px;
  height: 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.form-check-input:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  background-size: 100%;
}
.form-check-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(27, 94, 63, 0.14);
}
.form-check-label { font-size: 13px; color: var(--text); cursor: pointer; }
.form-check-inline { display: inline-flex; margin-right: 0.875rem; }

/* Toggle switches */
.form-switch .form-check-input {
  width: 2rem;
  height: 1rem;
  border-radius: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='4' cy='8' r='3' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 2px center;
  background-size: auto;
  background-color: var(--border-strong);
  transition: background-color var(--transition), background-position var(--transition);
}
.form-switch .form-check-input:checked {
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='12' cy='8' r='3' fill='white'/%3E%3C/svg%3E");
  background-position: right 2px center;
}

.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 0; flex: 1; }
.input-group .form-control:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .form-control:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.625rem;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  font-size: 11px;
  font-weight: 600;
  border-radius: 99px;
  letter-spacing: 0.02em;
}
.bg-success { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.bg-warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.bg-danger  { background: rgba(239, 68, 68, 0.12);  color: var(--danger);  }
.bg-secondary { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); }
.bg-primary { background: rgba(27, 94, 63, 0.1); color: var(--accent); }

/* ===== NATIVE DIALOG (replaces Bootstrap modal) ===== */
dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  min-width: 400px;
  max-width: 540px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  font-family: var(--font);
  font-size: var(--font-size);
  margin: 4rem auto auto auto;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 0.925rem; font-weight: 600; }
.modal-body { padding: 1.25rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ===== HTMX SPINNER ===== */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.htmx-request .htmx-indicator,
.htmx-indicator.htmx-request { opacity: 1; }

.htmx-indicator img { display: none; }

.htmx-indicator::after {
  content: '';
  width: 17px;
  height: 17px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== UTILITIES ===== */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

.w-100 { width: 100%; }
.min-vh-100 { min-height: 100vh; }

.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-start { text-align: left !important; }
.text-muted { color: var(--text-muted) !important; }
.text-white { color: white !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

.opacity-75 { opacity: 0.75; }
.opacity-50 { opacity: 0.5; }
.fw-bold { font-weight: 600; }
.fw-medium { font-weight: 500; }
.fs-5 { font-size: 1rem; }
.fs-6 { font-size: 0.875rem; }
.small { font-size: 11px; }
.pull-right { float: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-auto { margin-left: auto; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-0 { padding-left: 0; padding-right: 0; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.p-0 { padding: 0; }
.pt-2 { padding-top: 0.5rem; }
.ps-2 { padding-left: 0.5rem; }

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  max-width: 960px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem 0.375rem;
}
.card-header i { color: var(--accent); font-size: 1.1rem; }

.card-title {
  font-size: 0.925rem;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: 0 1rem 0.875rem;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.card-text {
  font-size: 13px;
  margin: 0.15rem 0;
}

.card-links { font-size: 13px; }
.card-links a { display: inline-block; line-height: 1.8; }
.card-link-sep { border: none; border-top: 1px solid var(--border); margin: 0.4rem 0; }

/* ===== TIME OFF CATEGORY COLORS ===== */
.timeoff-vacation        { background-color: rgba(59,  130, 246, 0.45); } /* blue     */
.timeoff-sick            { background-color: rgba(239,  68,  68, 0.50); } /* red      */
.timeoff-other           { background-color: rgba(100, 116, 139, 0.40); } /* slate    */
.timeoff-self-paid-leave { background-color: rgba(234,  88,  12, 0.45); } /* orange   */
.timeoff-public-holiday  { background-color: rgba( 20, 184, 166, 0.50); } /* teal     */
.timeoff-parental-leave  { background-color: rgba(147,  51, 234, 0.45); } /* purple   */
.timeoff-compensation-time { background-color: rgba(236, 72, 153, 0.45); } /* pink   */

/* ===== TOOLTIP ===== */
[data-tooltip] {
  position: relative;
  cursor: help;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--sidebar-bg);
  color: #dde7df;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 200;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ===== LIST GROUP ===== */
.list-group {
  display: flex;
  flex-direction: column;
}

.list-group-item {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.625rem 0.875rem;
}

.list-group-item + .list-group-item {
  border-top-width: 0;
}

.list-group-item:first-child {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

.list-group-item:last-child {
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.list-group-item-separated {
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.list-group-item-separated + .list-group-item {
  border-top-width: 1px;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

/* ===== APP-SPECIFIC: INVOICE ITEMS TABLE ===== */
.invoice-items .table th {
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--text);
}
.invoice-items .table tfoot td {
  font-size: 13px;
  color: var(--text);
}

/* ===== APP-SPECIFIC: TIMEOFF TABLE ===== */
.timeoff {
  width: 100%;
  border-collapse: collapse;
}
.timeoff-header-name {
  background-color: var(--sidebar-bg);
  color: white;
  padding: 4px;
  white-space: nowrap;
}
.timeoff-header-month {
  background-color: var(--sidebar-bg);
  color: white;
  padding: 0;
}
.timeoff-header-month-separator {
  background: var(--sidebar-bg);
  border-left: 1px solid var(--sidebar-bg);
  width: 0; min-width: 0; max-width: 0;
  padding: 0; margin: 0;
}
.timeoff-month-separator {
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  width: 0; min-width: 0; max-width: 0;
  padding: 0; margin: 0;
}
.timeoff-week-separator {
  border-left: 1px dashed var(--border);
  width: 0; min-width: 0; max-width: 0;
  padding: 0; margin: 0;
}
.timeoff-name { border-bottom: 1px solid var(--border); white-space: nowrap; padding: 2px 6px; }
.timeoff-day  { border-bottom: 1px solid var(--border); width: 5px; min-width: 5px; height: 20px; padding: 0; }
