/* Groundplan - Palantir Blueprint Inspired Design */

/* ============================================
   CSS Variables - Dark Theme
   ============================================ */
:root {
  /* Core colors - inspired by Palantir Blueprint */
  --bg-primary: #1c2127;
  --bg-secondary: #252a31;
  --bg-tertiary: #2f343c;
  --bg-hover: #383e47;
  --bg-active: #404854;
  
  /* Accent colors */
  --accent-blue: #2d72d2;
  --accent-blue-hover: #215db0;
  --accent-green: #238551;
  --accent-green-hover: #1c6e42;
  --accent-orange: #c87619;
  --accent-red: #cd4246;
  --accent-purple: #7961db;
  --accent-cyan: #06b6d4;
  --accent-yellow: #ca8a04;
  
  /* Text colors */
  --text-primary: #f6f7f9;
  --text-secondary: #abb3bf;
  --text-muted: #738091;
  --text-disabled: #5f6b7c;
  
  /* Border colors */
  --border-primary: #404854;
  --border-secondary: #5f6b7c;
  
  /* Status colors */
  --status-success: #32a467;
  --status-warning: #d1980b;
  --status-error: #e76a6e;
  --status-info: #4c90f0;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  
  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Border radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-display);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

.gp-icon {
  display: inline-block;
  vertical-align: middle;
  color: inherit;
  line-height: 1;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--text-primary);
}

/* ============================================
   Layout
   ============================================ */
.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas: 
    "sidebar header"
    "sidebar main";
  min-height: 100vh;
}

/* ============================================
   Header / Top Bar
   ============================================ */
.app-header {
  grid-area: header;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.header-title span {
  color: var(--text-primary);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-search {
  position: relative;
}

.header-search input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  padding: var(--space-sm) var(--space-md);
  padding-left: 36px;
  width: 280px;
  transition: all 0.15s ease;
}

.header-search input::placeholder {
  color: var(--text-muted);
}

.header-search input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.header-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

/* ============================================
   Sidebar
   ============================================ */
.app-sidebar {
  grid-area: sidebar;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-primary);
  height: 56px;
}

.sidebar-brand svg {
  width: 28px;
  height: 28px;
  color: var(--accent-blue);
}

.sidebar-brand h1 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-sm);
  margin-bottom: var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-blue);
  color: white;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--accent-red);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Sidebar user section */
.sidebar-user {
  padding: var(--space-md);
  border-top: 1px solid var(--border-primary);
}

/* ============================================
   Main Content
   ============================================ */
.app-main {
  grid-area: main;
  padding: var(--space-lg);
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: var(--space-xs);
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-primary);
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: var(--space-lg);
}

/* ============================================
   Stats / KPI Cards
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

/* Top accent (default) */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-accent, var(--accent-blue));
}

.stat-card.green::before { --stat-accent: var(--accent-green); }
.stat-card.orange::before { --stat-accent: var(--accent-orange); }
.stat-card.red::before { --stat-accent: var(--accent-red); }
.stat-card.purple::before { --stat-accent: var(--accent-purple); }

/* Left accent variant (removes top, adds left) */
.stat-card.accent-left::before {
  top: 0;
  bottom: 0;
  left: 0;
  right: auto;
  width: 3px;
  height: auto;
}

.stat-card.accent-left.green::before { --stat-accent: var(--accent-green); }
.stat-card.accent-left.orange::before { --stat-accent: var(--accent-orange); }
.stat-card.accent-left.red::before { --stat-accent: var(--accent-red); }
.stat-card.accent-left.purple::before { --stat-accent: var(--accent-purple); }

/* No accent variant */
.stat-card.no-accent::before {
  display: none;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.stat-details {
  font-size: 0.8125rem;
  margin-top: var(--space-xs);
}

.stat-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  border-top: 1px solid var(--border-primary);
  padding-top: var(--space-xs);
  margin-top: var(--space-xs);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-sans);
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.stat-change {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  font-weight: 500;
}

.stat-change.positive { color: var(--status-success); }
.stat-change.negative { color: var(--status-error); }

.stat-change svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   Data Tables
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead {
  background: var(--bg-tertiary);
}

.data-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-primary);
  white-space: nowrap;
  font-family: var(--font-display);
}

.data-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-primary);
  vertical-align: middle;
  font-family: var(--font-display);
  font-size: 0.875rem;
}

.data-table tbody tr {
  transition: background 0.1s ease;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

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

/* Table cell utilities */
.cell-mono {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: inherit;
}

/* Chart of accounts table layout */
.chart-accounts-table .col-account {
  width: 110px;
}

.chart-accounts-table .col-class {
  width: 190px;
}

.chart-accounts-table .col-budget {
  width: 80px;
}

.chart-accounts-table .col-status {
  width: 80px;
}

.chart-accounts-table .col-actions {
  width: 48px;
}

.chart-accounts-table th:nth-child(3),
.chart-accounts-table td:nth-child(3) {
  white-space: nowrap;
}

.cell-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

.btn-success {
  background: var(--accent-green);
  color: white;
}

.btn-success:hover {
  background: var(--accent-green-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-secondary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--accent-red);
  color: white;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.8125rem;
}

.btn-lg {
  padding: var(--space-md) var(--space-lg);
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   Status Badges
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 3px 8px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.badge-active, .badge-success {
  background: rgba(50, 164, 103, 0.15);
  color: var(--status-success);
}

.badge-pending, .badge-warning {
  background: rgba(209, 152, 11, 0.15);
  color: var(--status-warning);
}

.badge-error, .badge-rejected {
  background: rgba(231, 106, 110, 0.15);
  color: var(--status-error);
}

.badge-info {
  background: rgba(76, 144, 240, 0.15);
  color: var(--status-info);
}

.badge-neutral {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  padding: var(--space-sm) var(--space-md);
  transition: all 0.15s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(45, 114, 210, 0.2);
}

.form-select {
  cursor: pointer;
  appearance: none;
  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='%23738091' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.alert-warning {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #eab308;
}

.alert-info {
  background: rgba(45, 114, 210, 0.1);
  border: 1px solid rgba(45, 114, 210, 0.3);
  color: var(--accent-blue);
}

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

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-grid .span-2 {
  grid-column: span 2;
}

.required {
  color: var(--accent-red);
  margin-left: 2px;
}

/* Toggle buttons (Intern/Extern, etc) */
.toggle-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.toggle-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn:not(:last-child) {
  border-right: 1px solid var(--border-primary);
}

.toggle-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.toggle-btn.active {
  background: var(--accent-blue);
  color: white;
}

/* ============================================
   Progress Bars
   ============================================ */
.progress {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent-blue);
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
}

.progress-bar.green { background: var(--accent-green); }
.progress-bar.orange { background: var(--accent-orange); }
.progress-bar.red { background: var(--accent-red); }
.progress-bar.blue { background: var(--accent-blue); }

/* ============================================
   Avatars
   ============================================ */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.avatar-sm { width: 24px; height: 24px; font-size: 0.625rem; }
.avatar-lg { width: 40px; height: 40px; font-size: 0.875rem; }

/* ============================================
   Tabs
   ============================================ */
.tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-blue);
  color: white;
}

.tab-btn .badge-sm {
  font-size: 0.6875rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
}

.tab-btn:not(.active) .badge-sm {
  background: var(--bg-tertiary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================
   Modal
   ============================================ */
.modal,
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-primary);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Modal form styles */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.modal-form .form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.modal-form .form-group label {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.modal-form .form-input,
.modal-form .form-select,
.modal-form .form-textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.modal-form .form-input:focus,
.modal-form .form-select:focus,
.modal-form .form-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.modal-form .form-input::placeholder,
.modal-form .form-textarea::placeholder {
  color: var(--text-muted);
}

.modal-form .form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.modal-form .form-error {
  padding: var(--space-sm) var(--space-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--status-error);
  border-radius: var(--radius-md);
  color: var(--status-error);
  font-size: 0.875rem;
}

.modal-form .form-divider {
  height: 1px;
  background: var(--border-primary);
  margin: var(--space-sm) 0;
}

.modal-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
}

.modal-form .checkbox-label input {
  accent-color: var(--accent-blue);
  width: 16px;
  height: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg));
  border-top: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================
   Tabs
   ============================================ */
.tab-link {
  padding: var(--space-md) var(--space-xs);
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s ease;
}

.tab-link:hover {
  color: var(--text-primary);
}

.tab-link.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  font-weight: 500;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state-description {
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
}

/* ============================================
   Loading / Spinner
   ============================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-primary);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   User Menu
   ============================================ */
.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
  z-index: 100;
}

.user-menu:hover {
  background: var(--bg-hover);
}

/* User info shown in header next to avatar */
.user-menu-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.user-menu-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-menu-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Invisible backdrop to catch clicks outside dropdown */
.dropdown-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
}

/* Sidebar user info (legacy, can be removed) */
.user-info {
  text-align: right;
}

.user-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* User dropdown menu */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-xs);
  min-width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
}

.user-dropdown-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-primary);
}

.user-dropdown-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.user-dropdown-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.user-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.user-dropdown-item svg {
  opacity: 0.7;
}

.user-dropdown-item:hover svg {
  opacity: 1;
}

.user-dropdown-logout {
  color: var(--status-error);
  border-top: 1px solid var(--border-primary);
}

.user-dropdown-logout:hover {
  background: rgba(231, 106, 110, 0.1);
  color: var(--status-error);
}

/* Loading spinner for auth callback */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   Utility Classes
   ============================================ */

/* Text colors */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-success { color: var(--status-success); }
.text-danger { color: var(--status-error); }
.text-warning { color: var(--status-warning); }
.text-error { color: var(--status-error); }
.text-blue { color: var(--accent-blue); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-orange { color: var(--accent-orange); }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text size */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

/* Font weight */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }

/* Text transform */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.tracking-wide { letter-spacing: 0.05em; }

/* Danger hover for ghost buttons */
.btn-danger-hover:hover {
  color: var(--status-error);
  background: rgba(239, 68, 68, 0.1);
}

/* Flexbox */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-none { flex: none; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }

/* Gap */
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Margin */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mr-xs { margin-right: var(--space-xs); }
.mr-sm { margin-right: var(--space-sm); }
.mr-md { margin-right: var(--space-md); }
.ml-xs { margin-left: var(--space-xs); }
.ml-sm { margin-left: var(--space-sm); }
.ml-auto { margin-left: auto; }

/* Padding */
.p-0 { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Background */
.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }
.bg-hover { background: var(--bg-hover); }

/* Border radius */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 50%; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* ============================================
   Composite Utility Classes
   ============================================ */

/* Common flex patterns */
.flex-center { display: flex; align-items: center; }
.flex-center-gap { display: flex; align-items: center; gap: var(--space-sm); }
.flex-between { display: flex; justify-content: space-between; }
.flex-between-center { display: flex; justify-content: space-between; align-items: center; }
.flex-col-gap { display: flex; flex-direction: column; gap: var(--space-md); }

/* Section header (uppercase label) */
.section-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Card/panel styling */
.panel {
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.panel-tertiary {
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

/* Empty state center */
.empty-center {
  padding: var(--space-xl);
  text-align: center;
}

/* Table cell sizes */
.cell-right { text-align: right; }
.cell-center { text-align: center; }

/* Form row with label */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-md);
}

/* Clickable row */
.row-clickable {
  cursor: pointer;
}
.row-clickable:hover {
  background: var(--bg-hover);
}

/* Small text with margin */
.hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.label-hint {
  font-size: 0.75rem;
  margin-bottom: var(--space-xs);
}

/* Success/positive styling */
.text-positive { color: var(--accent-green); }
.text-negative { color: var(--accent-red); }

/* Inline badge-like labels */
.inline-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Grid */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Layout Grid System (6 columns)
   Standard grid for page layouts. Use col-X classes for spanning.
   All new pages should use this system for consistent alignment. */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-sm);
}
.layout-grid > .col-1 { grid-column: span 1; }
.layout-grid > .col-2 { grid-column: span 2; }
.layout-grid > .col-3 { grid-column: span 3; }
.layout-grid > .col-4 { grid-column: span 4; }
.layout-grid > .col-5 { grid-column: span 5; }
.layout-grid > .col-6 { grid-column: span 6; }

.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-flex { display: inline-flex; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 50%; }

.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.animate-slide-in {
  animation: slideIn 0.3s ease forwards;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ============================================
   Scrollbar styling
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-secondary);
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(ellipse at top left, rgba(45, 114, 210, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(121, 97, 219, 0.1) 0%, transparent 50%),
    var(--bg-primary);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: var(--space-xl);
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.login-logo svg {
  width: 40px;
  height: 40px;
  color: var(--accent-blue);
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.login-form .btn {
  width: 100%;
  margin-top: var(--space-md);
}

/* ============================================
   Checkbox Custom
   ============================================ */
.checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  background: var(--bg-primary);
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-wrapper:hover .checkbox-custom {
  border-color: var(--accent-blue);
}

.checkbox-wrapper input:checked + .checkbox-custom {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .app-sidebar,
  .app-header,
  .btn,
  .no-print {
    display: none !important;
  }
  
  .app-layout {
    display: block;
  }
  
  .app-main {
    padding: 0;
    margin: 0;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "header"
      "main";
  }
  
  .app-sidebar {
    display: none;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  
  .tab-btn {
    flex-shrink: 0;
  }
}

/* ============================================
   Personal Timesheet - Clean & Calming
   ============================================ */

.timesheet-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Welcome header */
.welcome-header {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
}

.welcome-greeting {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-date {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Week navigation */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
}

.week-nav-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.week-nav-btn:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
  transform: scale(1.05);
}

.week-info {
  text-align: center;
  min-width: 200px;
}

.week-label {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.week-dates {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Summary cards */
.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.summary-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  border: 1px solid var(--border-primary);
  transition: all 0.2s ease;
}

.summary-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-2px);
  background: var(--bg-tertiary);
}

.summary-value {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-card.overtime .summary-value { color: #f59e0b; }
.summary-card.complete .summary-value { color: #10b981; }

/* Equipment summary card */
.summary-card.equipment {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summary-equipment-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: 4px;
}

.equipment-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.equipment-row svg,
.equipment-row .accessory-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.equipment-row svg {
  color: var(--accent-purple);
}

.equipment-row .accessory-icon {
  color: var(--accent-cyan);
}

.equipment-hours {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
}

.equipment-hours.machine {
  color: var(--accent-purple);
}

.equipment-hours.accessory {
  color: var(--accent-cyan);
}

/* Role selector */
.role-selector {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-md);
}

.role-selector label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.role-selector select {
  padding: 4px 10px;
  font-size: 0.8125rem;
  border-radius: var(--radius-md);
}

/* Days list */
.days-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Day card */
.day-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s ease;
}

.day-card:hover {
  border-color: var(--border-secondary);
  background: var(--bg-tertiary);
}

.day-card.expanded {
  border-color: var(--accent-blue);
  box-shadow: 0 4px 20px rgba(45, 114, 210, 0.15);
}

.day-card.today {
  border-color: var(--accent-blue);
  border-left: 3px solid var(--accent-blue);
}

.day-card.weekend {
  background: var(--bg-primary);
  opacity: 0.6;
}

.day-card.weekend:hover { opacity: 1; }

/* Day header */
.day-header {
  display: flex;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  gap: var(--space-lg);
}

.day-header:hover {
  background: rgba(59, 130, 246, 0.02);
}

.day-info {
  min-width: 120px;
}

.day-name {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.day-date-small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.day-card.today .day-name {
  color: var(--status-info);
}

.today-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.625rem;
  font-weight: 600;
  background: var(--accent-blue);
  color: white;
  border-radius: var(--radius-sm);
  margin-left: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Entry pills */
.day-entries {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.entry-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-hover);
  border-radius: 20px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.entry-pill:hover {
  background: var(--bg-active);
  transform: scale(1.02);
}

.entry-pill-icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.entry-pill svg {
  width: 14px;
  height: 14px;
}

.entry-pill-hours {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.entry-pill.machine {
  background: rgba(121, 97, 219, 0.2);
  color: #a78bfa;
}

.entry-pill.accessory {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
}

.entry-pill.ata {
  background: rgba(35, 133, 81, 0.2);
  color: var(--accent-green);
}

.entry-text-muted {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Day total */
.day-total {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
  color: var(--text-primary);
}

.day-total.overtime { color: #f59e0b; }
.day-total.empty { color: var(--text-muted); font-weight: 400; }

/* Expand icon */
.day-expand {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.day-card.expanded .day-expand {
  background: var(--accent-blue);
  color: white;
  transform: rotate(180deg);
}

/* Day content */
.day-content {
  padding: 0 var(--space-lg) var(--space-lg);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.day-divider {
  height: 1px;
  background: var(--border-primary);
  margin-bottom: var(--space-md);
}

/* Entry section */
.entry-section {
  margin-bottom: var(--space-lg);
}

.entry-section:last-child { margin-bottom: 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.section-title svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* Column headers */
.column-headers {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1fr 1fr 70px 80px auto;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  margin-bottom: var(--space-xs);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.column-headers-machine { grid-template-columns: 2fr 1fr 2.5fr 70px auto; }
.column-headers-article { grid-template-columns: 2fr 2.5fr 70px 60px auto; }

/* Entry list */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.entry-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1fr 1fr 70px 80px auto;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.entry-row:hover {
  background: var(--bg-hover);
}

.entry-row-machine {
  grid-template-columns: 2fr 1fr 2.5fr 70px auto;
}

.entry-row-article {
  grid-template-columns: 2fr 2.5fr 70px 60px auto;
}

/* Entry inputs */
.entry-select, .entry-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.entry-select:focus, .entry-input:focus {
  border-color: var(--accent-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 114, 210, 0.2);
}

.entry-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.entry-input-hours {
  width: 70px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Delete button */
.entry-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
}

.entry-row:hover .entry-delete { opacity: 1; }

.entry-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

/* Add button */
.add-entry-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  color: var(--accent-blue);
  background: transparent;
  border: 1px dashed rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.add-entry-btn:hover {
  background: rgba(59, 130, 246, 0.05);
  border-color: var(--accent-blue);
}

.add-entry-btn svg {
  width: 14px;
  height: 14px;
}

/* Info hint */
.info-hint {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent-blue);
}

.info-hint svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent-blue);
}

/* Empty states */
.empty-day {
  text-align: center;
  padding: var(--space-lg);
  color: var(--text-muted);
}

.empty-day p {
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
}

.empty-articles {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0 var(--space-md);
}

/* Footer */
.timesheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
}

.footer-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-indicator.saved { background: var(--accent-green); }
.status-indicator.draft { background: var(--text-muted); }
.status-indicator.submitted { background: #f59e0b; }
.status-indicator.approved { background: var(--accent-green); }
.status-indicator.partial { background: #8b5cf6; }

.footer-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.button-group {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.locked-indicator {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Day status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 0.625rem;
  line-height: 1;
}

.status-badge.approved {
  color: var(--accent-green);
}

.status-badge.submitted {
  color: #f59e0b;
  font-size: 0.5rem;
}

.status-badge.partial {
  color: #8b5cf6;
}

/* Timesheet responsive */
@media (max-width: 768px) {
  .summary-row {
    grid-template-columns: 1fr;
  }
  
  .column-headers,
  .entry-row {
    display: none;
  }
  
  .day-entries {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   HIERARCHICAL TIME ENTRIES (New Structure)
   ============================================ */

.time-entries-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

/* Time entry card - the main container */
.time-entry-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: all 0.2s ease;
}

.time-entry-card:hover {
  border-color: var(--border-secondary);
}

/* ========================================
   TWO-ROW TIME ENTRY LAYOUT
   ======================================== */

/* Row 1: Main fields - Project, Roll, Hours, Overtime */
.time-entry-row-main {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.time-entry-row-main .entry-select-project {
  flex: 1;
  min-width: 200px;
}

.time-entry-row-main .entry-select-role {
  width: 160px;
}

.time-entry-row-main .entry-input-hours {
  width: 70px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
}

.time-entry-row-main .entry-select-overtime {
  width: 70px;
}

.time-entry-row-main .entry-delete {
  opacity: 1;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(205, 66, 70, 0.1);
  border: 1px solid rgba(205, 66, 70, 0.2);
  color: var(--accent-red);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.time-entry-row-main .entry-delete:hover {
  background: rgba(205, 66, 70, 0.2);
  border-color: var(--accent-red);
}

.time-entry-row-main .entry-delete:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Row 2: Detail fields - ÄTA, Aktivitet, Läge */
.time-entry-row-details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-primary);
}

.time-entry-row-details .detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  flex: 1;
}

.time-entry-row-details .detail-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.time-entry-row-details .detail-label .required-marker {
  color: var(--accent-red);
}

.time-entry-row-details .detail-field.missing .detail-label {
  color: var(--accent-red);
}

.time-entry-row-details .entry-select {
  font-size: 0.875rem;
}

.time-entry-row-details .entry-select.error {
  border-color: var(--accent-red);
  background: rgba(205, 66, 70, 0.05);
}

/* Saved state styling */
.time-entry-card.saved {
  opacity: 0.85;
  border-color: var(--accent-green);
  border-left: 3px solid var(--accent-green);
}

.time-entry-card.saved .entry-select,
.time-entry-card.saved .entry-input {
  background: var(--bg-secondary);
  cursor: not-allowed;
}

/* Legacy styles kept for compatibility */
/* Header row with main fields - use grid for alignment */
.time-entry-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-md);
}

/* Delete button on time entry - always visible */
.time-entry-header .entry-delete {
  opacity: 1;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(205, 66, 70, 0.1);
  border: 1px solid rgba(205, 66, 70, 0.2);
  color: var(--accent-red);
  border-radius: var(--radius-md);
}

.time-entry-header .entry-delete:hover {
  background: rgba(205, 66, 70, 0.2);
  border-color: var(--accent-red);
}

/* Fields grid - consistent alignment */
.time-entry-fields {
  display: grid;
  grid-template-columns: 2fr 80px 1.2fr 1fr 1.2fr 70px 80px;
  gap: var(--space-sm);
  align-items: center;
}

.time-entry-fields .entry-select,
.time-entry-fields .entry-input {
  font-size: 0.875rem;
  padding: 8px 12px;
  height: 38px;
}

.time-entry-fields .entry-select-small {
  /* Already sized by grid */
}

.time-entry-fields .entry-input-hours {
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Attached machine block - container for machine + its accessories */
.attached-machine-block {
  margin-top: var(--space-sm);
  margin-left: var(--space-lg);
}

/* Attached items (machines/accessories under a time entry) */
.attached-item {
  display: grid;
  grid-template-columns: 28px 1fr 70px 28px auto 28px;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--border-secondary);
  font-size: 0.875rem;
}

.attached-item.machine {
  border-left-color: var(--accent-purple);
  background: rgba(121, 97, 219, 0.08);
}

.attached-item.accessory {
  border-left-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  margin-top: var(--space-xs);
  margin-left: var(--space-md);
  grid-template-columns: 28px 1fr 70px 28px 28px;
  gap: var(--space-sm);
}

/* Icon container - consistent size */
.attached-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.attached-icon svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0;
}

.attached-item.machine .attached-icon {
  color: var(--accent-purple);
  background: rgba(121, 97, 219, 0.15);
}

.attached-item.accessory .attached-icon {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.15);
}

.attached-select {
  font-size: 0.875rem;
  padding: 8px 12px;
  height: 36px;
}

.attached-unit {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

/* Hours input in attached items */
.attached-item .entry-input-hours {
  font-size: 0.875rem;
  padding: 8px;
  height: 36px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
}

.attached-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
}

.attached-delete svg {
  width: 14px;
  height: 14px;
}

.attached-item:hover .attached-delete {
  opacity: 1;
}

.attached-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

/* Accessory button in machine row */
.attached-item .btn-ghost {
  font-size: 0.75rem;
  padding: 6px 10px;
  white-space: nowrap;
}

.attached-item .btn-ghost svg {
  width: 12px;
  height: 12px;
}

/* Action buttons for adding machines */
.time-entry-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  margin-left: var(--space-lg);
}

.add-attached-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px dashed var(--border-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.add-attached-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.add-attached-btn svg {
  width: 14px;
  height: 14px;
}

/* Add time entry button */
.add-time-entry-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-lg);
  margin-top: var(--space-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent-blue);
  background: transparent;
  border: 2px dashed rgba(45, 114, 210, 0.3);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-time-entry-btn:hover {
  background: rgba(45, 114, 210, 0.05);
  border-color: var(--accent-blue);
}

.add-time-entry-btn svg {
  width: 16px;
  height: 16px;
}

/* Day totals - split view for person/machine hours */
.day-totals {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 120px;
  justify-content: flex-end;
}

.day-total-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
}

.day-total-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

.day-total-item.person {
  background: rgba(45, 114, 210, 0.15);
  color: var(--accent-blue);
}

.day-total-item.machine {
  background: rgba(121, 97, 219, 0.15);
  color: var(--accent-purple);
}

.day-total-item.accessory {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

/* =====================================================
   Users Page - Additional styles
   ===================================================== */

.modal-error {
  background: rgba(205, 66, 70, 0.1);
  border: 1px solid rgba(205, 66, 70, 0.3);
  color: var(--accent-red);
  padding: var(--space-sm) var(--space-md);
  margin: 0 var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.modal-lg {
  max-width: 700px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-blue);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.summary-stats {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.summary-stats .stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  min-width: 120px;
}

.summary-stats .stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.summary-stats .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.span-2 {
  grid-column: span 2;
}

/* =====================================================
   Register Page (Machines, Vehicles, Accessories)
   ===================================================== */

.register-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.register-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.register-title-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  margin-bottom: var(--space-xs);
}

.breadcrumb-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb-link:hover {
  color: var(--accent-blue);
}

.breadcrumb-sep {
  color: var(--border-color);
}

.breadcrumb-current {
  color: var(--text-secondary);
}

.register-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.register-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.register-tabs {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-xs);
}

.register-tab {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.register-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.register-tab.active {
  background: var(--accent-blue);
  color: white;
}

.register-tab svg {
  opacity: 0.8;
}

.register-tab.active svg {
  opacity: 1;
}

.tab-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.register-tab:not(.active) .tab-count {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.tab-count.warning {
  background: var(--accent-orange);
  color: white;
}

/* Sub-tabs (within content area) */
.sub-tabs {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.sub-tab {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.sub-tab:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sub-tab.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sub-tab-count {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sub-tab.active .sub-tab-count {
  background: var(--accent-blue);
  color: white;
}

/* Register filters */
.register-filters {
  margin-bottom: var(--space-md);
}

.filter-row {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  flex: 1;
  max-width: 300px;
}

.search-box svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.filter-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  min-width: 150px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
}

.filter-checkbox input {
  accent-color: var(--accent-blue);
}

/* Table footer */
.table-footer {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-sm) 0;
  font-size: 0.8125rem;
}

/* Costed article field highlight */
.costed-field {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-sm);
}

/* Standard prices info box */
.standard-prices-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.standard-prices-info svg {
  flex-shrink: 0;
  color: var(--accent-blue);
}

/* Standard item cell */
.standard-item-cell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.standard-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
}

.standard-item-icon.time-role {
  color: var(--accent-purple);
}

.standard-item-icon.machine {
  color: var(--accent-blue);
}

.standard-item-icon.article {
  color: var(--accent-green);
}

.standard-item-name {
  font-weight: 500;
  color: var(--text-primary);
}

/* Toggle for showing inactive items */
.tabs-spacer {
  flex: 1;
}

.toggle-inactive {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.toggle-inactive input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.toggle-inactive input:checked + .toggle-switch {
  background: var(--accent-blue);
}

.toggle-inactive input:checked + .toggle-switch::after {
  transform: translateX(16px);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.inactive-count {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Toggle field in forms */
.toggle-field {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  user-select: none;
}

.toggle-field input[type="checkbox"] {
  display: none;
}

.toggle-text {
  color: var(--text-primary);
  font-size: 0.875rem;
}

/* Inactive row styling */
.inactive-row {
  opacity: 0.6;
}

.inactive-row:hover {
  opacity: 0.8;
}

/* Role name cell for time roles */
.role-name-cell,
.price-list-name-cell,
.machine-name-cell,
.article-name-cell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.role-icon,
.price-list-icon,
.machine-icon,
.article-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
}

.role-name,
.price-list-name,
.machine-name,
.article-name {
  font-weight: 500;
  color: var(--text-primary);
}

.price-list-link {
  text-decoration: none;
  color: inherit;
}

.price-list-link:hover .price-list-name {
  color: var(--accent-blue);
}

/* User count badge */
.user-count-badge,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 var(--space-xs);
  background: var(--accent-blue);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.count-badge-success {
  background: var(--accent-green);
  border-radius: var(--radius-sm);
}

.register-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xxl);
  color: var(--text-muted);
  gap: var(--space-md);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Search Field */
.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md) var(--space-sm) 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Project List Styles */
.project-name {
  font-weight: 500;
  color: var(--text-primary);
}

.project-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-row:hover {
  background-color: var(--bg-tertiary);
}

/* Register Table */
.register-table {
  width: 100%;
  border-collapse: collapse;
}

.register-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  white-space: nowrap;
  font-family: var(--font-display);
}

.register-table th.text-right {
  text-align: right;
}

.register-table th.text-center {
  text-align: center;
}

.register-table th:first-child {
  border-radius: var(--radius-lg) 0 0 0;
}

.register-table th:last-child {
  border-radius: 0 var(--radius-lg) 0 0;
}

.register-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-primary);
  vertical-align: middle;
  font-family: var(--font-display);
  font-size: 0.875rem;
}

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

.register-table tr:hover td {
  background: var(--bg-tertiary);
}

/* Time roles table column alignment */


.machine-name-cell {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.machine-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.machine-info h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.machine-info p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.machine-number {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.machine-badges {
  display: flex;
  gap: var(--space-xs);
}

.machine-actions {
  display: flex;
  gap: var(--space-xs);
  justify-content: flex-end;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xxl);
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin: 0 0 var(--space-xs) 0;
}

.empty-state p {
  color: var(--text-muted);
  margin: 0;
}

/* Recycle Bin */
.recycle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-primary);
}

.recycle-item:last-child {
  border-bottom: none;
}

.recycle-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.recycle-info h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.recycle-info p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.recycle-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Register Table Container */
.register-table-container {
  padding: 0;
}

/* Clickable rows */
.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: var(--bg-hover);
}

/* Table cells */
.name-cell {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.name-text {
  font-weight: 500;
  color: var(--text-primary);
}

.mono {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: inherit;
}

.number {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-secondary);
}

.actions-col {
  width: 50px;
}

.actions-cell {
  text-align: right;
}

/* Type badges */
.type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
}

.type-badge.machine {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
}

.type-badge.vehicle {
  background: rgba(45, 114, 210, 0.15);
  color: var(--accent-blue);
}

.type-badge.accessory {
  background: rgba(121, 97, 219, 0.15);
  color: var(--accent-purple);
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
}

.status-badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
}

.status-badge.inactive {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* Icons in tables */
.machine-icon,
.vehicle-icon,
.accessory-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.machine-icon {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
}

.vehicle-icon {
  background: rgba(45, 114, 210, 0.15);
  color: var(--accent-blue);
}

.accessory-icon {
  background: rgba(121, 97, 219, 0.15);
  color: var(--accent-purple);
}

/* Icon button */
.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* =====================================================
   Machine Detail Page
   ===================================================== */

.machine-detail-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--text-primary);
}

.detail-actions {
  display: flex;
  gap: var(--space-sm);
}

.detail-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.machine-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.machine-icon-large {
  width: 80px;
  height: 80px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.machine-title-section {
  flex: 1;
}

.machine-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 var(--space-sm) 0;
}

.machine-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.reg-number {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.machine-status {
  flex-shrink: 0;
}

.machine-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-primary);
}

.detail-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.detail-item span {
  font-size: 0.9375rem;
  font-weight: 500;
}

.project-number {
  font-family: var(--font-mono);
  color: var(--accent-blue);
}

.pricing-info-note {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: rgba(45, 114, 210, 0.1);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Accessories */
.accessories-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-primary);
}

.accessories-card .card-header h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.accessories-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.accessory-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.accessory-icon {
  width: 40px;
  height: 40px;
  background: rgba(121, 97, 219, 0.15);
  color: var(--accent-purple);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.accessory-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.accessory-name {
  font-weight: 500;
}

.accessory-type {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.empty-accessories,
.empty-state-small {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
}

.empty-accessories span,
.empty-state-small span {
  display: block;
}

.hint {
  font-size: 0.8125rem;
  margin-top: var(--space-xs);
}

.not-found {
  text-align: center;
  padding: var(--space-xl);
}

.not-found h2 {
  margin-bottom: var(--space-md);
}

/* Button variants */
.btn-danger {
  background: var(--accent-red);
  color: white;
}

.btn-danger:hover {
  background: #b83a3e;
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}

.btn-danger-outline:hover {
  background: rgba(205, 66, 70, 0.1);
}

.btn-ghost.btn-danger {
  background: transparent;
  color: var(--accent-red);
}

.btn-ghost.btn-danger:hover {
  background: rgba(205, 66, 70, 0.1);
}

.modal-sm {
  max-width: 400px;
}

.text-muted {
  color: var(--text-muted);
}

/* =====================================================
   Users Page - Role Badges & Stats
   ===================================================== */


/* Role Badges */
.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

.role-admin {
  background: rgba(121, 97, 219, 0.15);
  color: var(--accent-purple);
}

.role-projektstod {
  background: rgba(236, 72, 153, 0.15);
  color: var(--accent-pink, #ec4899);
}

.role-platsledning {
  background: rgba(45, 114, 210, 0.15);
  color: var(--accent-blue);
}

.role-yrkesarbetare {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
}

.role-extern {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
}

.role-lasrattighet {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

/* Role-colored avatars */
.avatar.role-admin {
  background: var(--accent-purple);
  color: white;
}

.avatar.role-projektstod {
  background: var(--accent-pink, #ec4899);
  color: white;
}

.avatar.role-platsledning {
  background: var(--accent-blue);
  color: white;
}

.avatar.role-yrkesarbetare {
  background: var(--accent-green);
  color: white;
}

.avatar.role-extern {
  background: var(--accent-orange);
  color: white;
}

.avatar.role-lasrattighet {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

/* ============================================
   Settings Page
   ============================================ */

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: left;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.settings-nav-item.active {
  background: var(--accent-blue);
  color: white;
}

.settings-nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.settings-nav-item.active svg {
  opacity: 1;
}

.code-inline {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.integration-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
}

.integration-logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 1.5rem;
}

.integration-info {
  flex: 1;
}

.integration-info h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
}

.integration-info p {
  font-size: 0.8125rem;
  margin: var(--space-xs) 0 0;
}

/* ============================================
   Login Page - Modern Minimalist Design
   ============================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(ellipse at top, rgba(45, 114, 210, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(121, 97, 219, 0.1) 0%, transparent 50%),
    var(--bg-primary);
  padding: var(--space-lg);
}

.login-container {
  width: 100%;
  max-width: 420px;
  animation: loginFadeIn 0.5s ease-out;
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: var(--space-xl);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.login-logo svg {
  width: 44px;
  height: 44px;
  color: var(--accent-blue);
  filter: drop-shadow(0 2px 8px rgba(45, 114, 210, 0.4));
}

.login-logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.login-error {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(231, 106, 110, 0.12);
  border: 1px solid rgba(231, 106, 110, 0.3);
  border-radius: var(--radius-md);
  color: var(--status-error);
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
}

.login-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.login-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px var(--space-lg);
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--accent-blue), #4a7fd4);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 
    0 2px 8px rgba(45, 114, 210, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.login-button:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-blue-hover), var(--accent-blue));
  transform: translateY(-1px);
  box-shadow: 
    0 4px 16px rgba(45, 114, 210, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.login-button:active:not(:disabled) {
  transform: translateY(0);
}

.login-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-button svg {
  width: 22px;
  height: 22px;
}

.login-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-primary);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.login-security svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.login-heart {
  color: var(--status-error);
  animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ============================================
   Session Warning Modal
   ============================================ */
.session-warning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.session-warning-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 420px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--accent-orange);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.session-warning-icon {
  margin-bottom: var(--space-lg);
}

.session-warning-icon svg {
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.session-warning-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-md) 0;
}

.session-warning-text {
  color: var(--text-secondary);
  margin: 0 0 var(--space-xl) 0;
  line-height: 1.6;
}

.session-warning-text strong {
  color: var(--accent-orange);
  font-weight: 600;
}

.session-warning-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.session-warning-actions .btn-primary {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}

.session-warning-actions .btn-primary:hover {
  background: #b06a15;
  border-color: #b06a15;
}

/* Session timeout message on login page */
.session-timeout-message {
  background: linear-gradient(135deg, rgba(200, 118, 25, 0.15), rgba(200, 118, 25, 0.05));
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.session-timeout-message svg {
  flex-shrink: 0;
  color: var(--accent-orange);
}

.session-timeout-message p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ============================================
   Landing Page
   ============================================ */
.landing-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0d1117 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.landing-content {
  text-align: center;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.landing-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-logo svg {
  width: 100%;
  height: 100%;
  stroke: white;
}

.landing-title {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.landing-tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin: 0 0 var(--space-xl) 0;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin: 0 auto var(--space-xl) auto;
  max-width: 500px;
  justify-content: center;
}

@media (min-width: 768px) {
  .landing-features {
    grid-template-columns: repeat(4, 1fr);
    max-width: 650px;
    gap: var(--space-md);
  }
}

@media (min-width: 1200px) {
  .landing-features {
    grid-template-columns: repeat(8, 1fr);
    max-width: 1100px;
    gap: var(--space-md);
  }
}

.landing-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  transition: all 0.25s ease;
  text-align: center;
  aspect-ratio: 1 / 0.85;
  text-decoration: none;
  cursor: pointer;
}

.landing-feature:hover {
  border-color: var(--accent-blue);
  transform: translateY(-4px);
  background: var(--bg-tertiary);
  box-shadow: 0 8px 24px rgba(45, 114, 210, 0.15);
}

.landing-feature:hover svg {
  transform: scale(1.1);
}

.landing-feature:hover span {
  color: var(--accent-blue);
}

.landing-feature svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent-blue);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.landing-feature span {
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  transition: color 0.25s ease;
}

.landing-actions {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  justify-content: center;
}

.landing-actions .btn-large {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
  gap: var(--space-sm);
  min-width: 160px;
}

.landing-actions .btn-large svg {
  width: 20px;
  height: 20px;
}

.landing-actions .btn-secondary {
  background: transparent;
  border: 1px solid var(--border-secondary);
  color: var(--text-primary);
}

.landing-actions .btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-blue);
}

.landing-footer {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.landing-footer p {
  margin: 0;
}

.landing-heart {
  color: var(--status-error);
  animation: heartbeat 1.5s ease infinite;
}

/* ============================================
   Feature Article Page
   ============================================ */
.feature-article-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0d1117 100%);
  padding: var(--space-xl);
}

.feature-article {
  max-width: 800px;
  margin: 0 auto;
}

.feature-back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: var(--space-xl);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.feature-back-link:hover {
  color: var(--accent-blue);
}

.feature-back-link svg {
  width: 16px;
  height: 16px;
}

.feature-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.feature-icon-large {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.feature-icon-large svg {
  width: 40px;
  height: 40px;
  stroke: white;
}

.feature-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.feature-subtitle {
  font-size: 1.25rem;
  color: var(--accent-blue);
  margin: 0;
}

.feature-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.feature-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 var(--space-xl) 0;
}

.feature-benefits h2 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0 0 var(--space-md) 0;
}

.feature-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-benefits li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-primary);
}

.feature-benefits li:last-child {
  border-bottom: none;
}

.feature-benefits li svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent-green);
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-cta {
  background: linear-gradient(135deg, rgba(45, 114, 210, 0.1) 0%, rgba(121, 97, 219, 0.1) 100%);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.feature-cta h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.feature-cta p {
  color: var(--text-secondary);
  margin: 0 0 var(--space-lg) 0;
}

.feature-cta-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.feature-not-found {
  text-align: center;
  padding: var(--space-xl);
}

.feature-not-found h1 {
  color: var(--text-primary);
  margin: 0 0 var(--space-md) 0;
}

.feature-not-found p {
  color: var(--text-secondary);
  margin: 0 0 var(--space-lg) 0;
}

/* ============================================
   Contact Page
   ============================================ */
.contact-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0d1117 100%);
  padding: var(--space-xl);
}

.contact-container {
  max-width: 600px;
  margin: 0 auto;
}

.contact-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.contact-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.contact-icon svg {
  width: 40px;
  height: 40px;
  stroke: white;
}

.contact-header h1 {
  font-size: 2rem;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.contact-subtitle {
  color: var(--text-secondary);
  margin: 0;
}

.contact-form {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.form-group .required {
  color: var(--status-error);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

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

.contact-submit {
  width: 100%;
  justify-content: center;
  margin-top: var(--space-md);
}

.contact-success {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.contact-success-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent-green) 0%, #1c6e42 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.contact-success-icon svg {
  width: 32px;
  height: 32px;
  stroke: white;
}

.contact-success h2 {
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.contact-success p {
  color: var(--text-secondary);
  margin: 0 0 var(--space-lg) 0;
}

.contact-info {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
}

.contact-info-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent-blue);
}

/* =====================================================
   TIME REPORTS PAGE - Comprehensive View
   ===================================================== */

/* Summary row */
.tr-summary-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.tr-summary-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  transition: all 0.2s ease;
}

.tr-summary-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-2px);
}

.tr-summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tr-summary-card.person .tr-summary-value { color: var(--accent-blue); }
.tr-summary-card.machine .tr-summary-value { color: #d97706; }
.tr-summary-card.accessory .tr-summary-value { color: #7c3aed; }

.tr-summary-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tr-summary-status-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.status-item {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.status-item.draft { color: var(--text-muted); }
.status-item.submitted { color: #d97706; background: rgba(245, 158, 11, 0.1); }
.status-item.approved { color: var(--accent-green); background: rgba(16, 185, 129, 0.1); }

/* View mode tabs */
.tr-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  margin-bottom: var(--space-lg);
  width: fit-content;
}

.tr-view-tab {
  padding: 0.625rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.tr-view-tab:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.tr-view-tab.active {
  background: var(--accent-blue);
  color: white;
}

/* Filters */
.tr-filters {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.tr-filter-row {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.tr-filter-row + .tr-filter-row {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-primary);
}

.tr-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.tr-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tr-filter-select,
.tr-filter-input {
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s;
}

.tr-filter-select {
  padding-right: 2rem;
  appearance: none;
  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='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

.tr-filter-select:focus,
.tr-filter-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.tr-quick-dates {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.tr-quick-date-btn {
  padding: 0.375rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.tr-quick-date-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Batch actions bar */
.tr-batch-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--accent-blue);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  color: white;
}

.tr-batch-count {
  font-weight: 600;
}

.tr-batch-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.tr-batch-bar .btn-ghost {
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.3);
}

.tr-batch-bar .btn-primary {
  background: white;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Content area */
.tr-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tr-table-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
}

.tr-result-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Data table */
.tr-table-container {
  overflow-x: auto;
}

.tr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.tr-table thead {
  background: var(--bg-tertiary);
  border-bottom: 2px solid var(--border-primary);
}

.tr-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.tr-th-checkbox,
.tr-td-checkbox {
  width: 40px;
  text-align: center;
}

.tr-th-expand,
.tr-td-expand {
  width: 40px;
  text-align: center;
}

.tr-th-right {
  text-align: right !important;
}

.tr-table tbody tr {
  border-bottom: 1px solid var(--border-primary);
  transition: background 0.15s;
}

.tr-row:hover {
  background: var(--bg-tertiary);
}

.tr-row.selected {
  background: rgba(45, 114, 210, 0.08);
}

.tr-row.approved {
  opacity: 0.65;
}

.tr-row.expanded {
  background: var(--bg-tertiary);
}

.tr-table td {
  padding: var(--space-sm) var(--space-md);
  vertical-align: middle;
}

/* Checkbox */
.tr-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tr-checkbox input {
  display: none;
}

.tr-checkbox-mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-secondary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  background: var(--bg-primary);
}

.tr-checkbox:hover .tr-checkbox-mark {
  border-color: var(--accent-blue);
}

.tr-checkbox input:checked + .tr-checkbox-mark {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.tr-checkbox input:checked + .tr-checkbox-mark::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* Expand button */
.tr-expand-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}

.tr-expand-btn:hover {
  background: var(--accent-blue);
  color: white;
}

.tr-expand-btn svg {
  transition: transform 0.2s;
}

.tr-expand-btn svg.rotated {
  transform: rotate(180deg);
}

/* Cell styles */
.tr-td-date {
  font-weight: 500;
  white-space: nowrap;
}

.tr-td-user {
  font-weight: 500;
}

.tr-td-project {
  max-width: 250px;
}

.tr-project-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tr-project-number {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tr-project-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tr-ata-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.625rem;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  width: fit-content;
}

.tr-td-hours {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tr-td-hours.person { color: var(--accent-blue); }
.tr-td-hours.machine { color: #d97706; }
.tr-td-hours.accessory { color: #7c3aed; }

/* Status badge */
.tr-status-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tr-status-badge.draft {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.tr-status-badge.submitted {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.tr-status-badge.approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

/* Detail row */
.tr-detail-row {
  background: var(--bg-primary) !important;
}

.tr-detail-row:hover {
  background: var(--bg-primary) !important;
}

.tr-detail-content {
  padding: var(--space-md) var(--space-lg);
  margin-left: 80px;
  border-left: 3px solid var(--accent-blue);
}

.tr-detail-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.tr-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tr-detail-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
}

.tr-detail-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-primary);
}

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

.tr-ata-number {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
  border-radius: var(--radius-sm);
}

.tr-machine-item,
.tr-accessory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding: 2px 0;
}

.tr-machine-name {
  font-weight: 500;
  color: #d97706;
}

.tr-machine-hours {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tr-accessory-name {
  font-weight: 500;
  color: #7c3aed;
}

.tr-accessory-hours {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Grouped views (Per person, Per maskin, etc.) */
.tr-grouped-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.tr-grouped-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all 0.2s ease;
}

.tr-grouped-card:hover {
  border-color: var(--border-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tr-grouped-card.machine {
  border-left: 3px solid #d97706;
}

.tr-grouped-card.project {
  border-left: 3px solid var(--accent-blue);
}

.tr-grouped-card.ata {
  border-left: 3px solid #7c3aed;
}

.tr-grouped-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.tr-grouped-header svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.tr-grouped-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.tr-grouped-project-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tr-grouped-project-number {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tr-grouped-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: auto;
  background: var(--bg-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
}

.tr-grouped-pending {
  font-size: 0.75rem;
  color: #d97706;
  background: rgba(245, 158, 11, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-weight: 500;
}

.tr-grouped-stats {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.tr-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.tr-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tr-stat.person .tr-stat-value {
  color: var(--accent-blue);
}

.tr-stat.machine .tr-stat-value {
  color: #d97706;
}

.tr-stat.accessory .tr-stat-value {
  color: #7c3aed;
}

.tr-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tr-ata-badge-large {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
  border-radius: var(--radius-md);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Responsive */
@media (max-width: 1024px) {
  .tr-summary-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .tr-summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tr-filter-row {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .tr-filter-group {
    min-width: 100%;
  }
  
  .tr-view-tabs {
    width: 100%;
    overflow-x: auto;
  }
}

/* =====================================================
   COST VIEW (Kostnadsanalys)
   ===================================================== */

/* Cost trend chart */
.cost-trend-chart {
  height: 140px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: var(--space-md) 0;
}

.cost-trend-bar {
  flex: 1;
  background: var(--accent-blue);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  position: relative;
  cursor: pointer;
  transition: opacity 0.15s;
}

.cost-trend-bar:hover {
  opacity: 0.8;
}

.cost-trend-bar::before {
  content: attr(data-label);
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.5625rem;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
}

.cost-trend-bar:nth-child(4n)::before {
  opacity: 1;
}

.cost-trend-bar::after {
  content: attr(data-value);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.625rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.cost-trend-bar:hover::after {
  opacity: 1;
}

/* View toggle */
.cost-view-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: 6px;
  padding: 2px;
}

.cost-view-toggle button {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.cost-view-toggle button:hover {
  color: var(--text-primary);
}

.cost-view-toggle button.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Source indicator badges */
.cost-source-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.cost-source-time {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.cost-source-invoice {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.cost-source-articles {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
}

.cost-source-manual {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
}

/* Filter chips */
.cost-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cost-filter-chip:hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}

.cost-filter-chip.active {
  background: var(--accent-blue);
  color: white;
}

.cost-filter-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* Expandable cost rows */
.cost-row-expandable {
  cursor: pointer;
}

.cost-row-expandable:hover {
  background: var(--bg-hover);
}

.cost-row-expandable .expand-icon {
  transition: transform 0.2s;
  color: var(--text-muted);
}

.cost-row-expandable.expanded .expand-icon {
  transform: rotate(90deg);
}

.cost-row-details {
  display: none;
}

.cost-row-expandable.expanded + .cost-row-details {
  display: table-row;
}

.cost-row-details td {
  padding: 0 !important;
}

.cost-row-details-inner {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-blue);
  margin-left: var(--space-lg);
}

.cost-row-details-inner table {
  margin: 0;
}

/* Cost table specific */
.cell-amount {
  font-family: var(--font-mono);
  text-align: right;
  font-weight: 500;
  font-weight: 500;
}

.cell-amount-positive {
  color: var(--accent-green);
}

.table-footer-row {
  font-weight: 600;
  background: var(--bg-secondary);
}

.cell-dim {
  color: var(--text-muted);
}

.cell-nowrap {
  white-space: nowrap;
}

/* Breakdown bar */
.cost-breakdown-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.cost-breakdown-bar > div {
  height: 100%;
  transition: width 0.3s ease;
}

/* Cost summary header */
.cost-summary-header {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.cost-summary-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cost-summary-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.cost-summary-values {
  display: flex;
  flex-direction: column;
}

.cost-summary-amount {
  font-weight: 600;
  font-size: 1rem;
}

.cost-summary-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
