:root {
  font-family: 'DM Sans', system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Common or default variables (Dark Mode) */
  --bg-main: #0f1117;
  --bg-sidebar: #131622;
  --bg-card: rgba(26, 29, 46, 0.7);
  --bg-card-hover: rgba(35, 39, 61, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.35);

  --color-primary: #2563eb;
  /* Electric Blue */
  --color-secondary: #06b6d4;
  /* Cyan */
  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;

  /* Status Colors */
  --status-uus-text: #f59e0b;
  --status-uus-bg: rgba(245, 158, 11, 0.15);
  --status-uus-border: rgba(245, 158, 11, 0.3);

  --status-ootel-text: #f97316;
  --status-ootel-bg: rgba(249, 115, 22, 0.15);
  --status-ootel-border: rgba(249, 115, 22, 0.3);

  --status-toos-text: #3b82f6;
  --status-toos-bg: rgba(59, 130, 246, 0.15);
  --status-toos-border: rgba(59, 130, 246, 0.3);

  --status-lopetatud-text: #10b981;
  --status-lopetatud-bg: rgba(16, 185, 129, 0.15);
  --status-lopetatud-border: rgba(16, 185, 129, 0.3);



  /* Form & Input controls */
  --form-control-bg: rgba(255, 255, 255, 0.03);
  --form-control-focus-bg: rgba(255, 255, 255, 0.05);
  --form-control-color: white;
  --select-option-bg: #1a1d2e;

  /* Login Background & Elements */
  --bg-login-gradient: radial-gradient(circle at 50% 50%, #1e2544 0%, #0c0e17 100%);
  --bg-login-card: rgba(19, 22, 34, 0.8);
  --logo-color-white: #ffffff;
  --logo-gradient-start: #1d4ed8;
  --logo-gradient-end: #22d3ee;

  color: #e2e8f0;
  background-color: #0f1117;
}

/* Explicit dark theme class (for manual override or fallback) */
html.dark {
  --bg-main: #0f1117;
  --bg-sidebar: #131622;
  --bg-card: rgba(26, 29, 46, 0.7);
  --bg-card-hover: rgba(35, 39, 61, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.35);

  --color-primary: #2563eb;
  --color-secondary: #06b6d4;
  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;

  /* Status Colors */
  --status-uus-text: #f59e0b;
  --status-uus-bg: rgba(245, 158, 11, 0.15);
  --status-uus-border: rgba(245, 158, 11, 0.3);

  --status-ootel-text: #f97316;
  --status-ootel-bg: rgba(249, 115, 22, 0.15);
  --status-ootel-border: rgba(249, 115, 22, 0.3);

  --status-toos-text: #3b82f6;
  --status-toos-bg: rgba(59, 130, 246, 0.15);
  --status-toos-border: rgba(59, 130, 246, 0.3);

  --status-lopetatud-text: #10b981;
  --status-lopetatud-bg: rgba(16, 185, 129, 0.15);
  --status-lopetatud-border: rgba(16, 185, 129, 0.3);



  --form-control-bg: rgba(255, 255, 255, 0.03);
  --form-control-focus-bg: rgba(255, 255, 255, 0.05);
  --form-control-color: white;
  --select-option-bg: #1a1d2e;

  --bg-login-gradient: radial-gradient(circle at 50% 50%, #1e2544 0%, #0c0e17 100%);
  --bg-login-card: rgba(19, 22, 34, 0.8);
  --logo-color-white: #ffffff;

  color: #e2e8f0;
  background-color: #0f1117;
}

/* Light Theme overrides */
html.light {
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(37, 99, 235, 0.2);

  --color-primary: #2563eb;
  --color-secondary: #0891b2;
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;

  /* Status Colors - Light Mode (high contrast, readable text) */
  --status-uus-text: #b45309; /* amber-700 */
  --status-uus-bg: rgba(245, 158, 11, 0.08);
  --status-uus-border: rgba(245, 158, 11, 0.2);

  --status-ootel-text: #c2410c; /* orange-700 */
  --status-ootel-bg: rgba(249, 115, 22, 0.08);
  --status-ootel-border: rgba(249, 115, 22, 0.2);

  --status-toos-text: #1d4ed8; /* blue-700 */
  --status-toos-bg: rgba(59, 130, 246, 0.08);
  --status-toos-border: rgba(59, 130, 246, 0.2);

  --status-lopetatud-text: #047857; /* emerald-700 */
  --status-lopetatud-bg: rgba(16, 185, 129, 0.08);
  --status-lopetatud-border: rgba(16, 185, 129, 0.2);



  --form-control-bg: rgba(0, 0, 0, 0.02);
  --form-control-focus-bg: rgba(0, 0, 0, 0.04);
  --form-control-color: #0f172a;
  --select-option-bg: #ffffff;

  --bg-login-gradient: radial-gradient(circle at 50% 50%, #eff6ff 0%, #dbeafe 100%);
  --bg-login-card: rgba(255, 255, 255, 0.95);
  --logo-color-white: #0f172a;

  color: #334155;
  background-color: #f8fafc;
}

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

/* Base Headings & Buttons styling using Outfit font */
h1, h2, h3, h4, h5, h6, .logo-title, .login-card-title, .panel-title, .page-title, .btn {
  font-family: 'Outfit', system-ui, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  background-color: var(--bg-main);
  overflow: hidden;
}

#root {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* App Container */
.app-container {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Navigation Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  height: 100%;
  z-index: 100;
  transition: transform 0.3s ease;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 5.5rem; /* Leave space for toggles underneath logo */
  padding: 0.5rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon-svg {
  width: 100%;
  height: 100%;
}

.logo-text-wrapper {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--logo-color-white);
}

.logo-title span {
  font-weight: 300;
  color: var(--color-secondary);
  margin-left: 0.15rem;
}

.logo-subtitle {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  width: 100%;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--color-text-main);
  background-color: rgba(0, 0, 0, 0.03);
}

html.dark .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
  color: var(--color-text-main);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.02));
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.15);
}

html.light .nav-link.active {
  color: var(--color-primary);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(8, 145, 178, 0.03));
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.08);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 2rem;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  min-width: 0;
  /* Crucial: prevents content from stretching the container horizontally */
}

/* Loading Overlay & Spinner */
.global-loading {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 30px;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(10px);
  color: white;
  font-size: 0.85rem;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border-left-color: var(--color-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Dashboard Header & Toolbar */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text-main);
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.stat-card.uus {
  border-color: var(--status-uus-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 12px rgba(245, 158, 11, 0.08);
}
.stat-card.uus:hover {
  transform: translateY(-2px);
  border-color: var(--status-uus-text);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.2), 0 0 20px rgba(245, 158, 11, 0.15);
}

.stat-card.ootel {
  border-color: var(--status-ootel-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 12px rgba(249, 115, 22, 0.08);
}
.stat-card.ootel:hover {
  transform: translateY(-2px);
  border-color: var(--status-ootel-text);
  box-shadow: 0 8px 30px rgba(249, 115, 22, 0.2), 0 0 20px rgba(249, 115, 22, 0.15);
}

.stat-card.toos {
  border-color: var(--status-toos-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 12px rgba(37, 99, 235, 0.08);
}
.stat-card.toos:hover {
  transform: translateY(-2px);
  border-color: var(--status-toos-text);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.2), 0 0 20px rgba(37, 99, 235, 0.15);
}

.stat-card.lopetatud {
  border-color: var(--status-lopetatud-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 12px rgba(16, 185, 129, 0.08);
}
.stat-card.lopetatud:hover {
  transform: translateY(-2px);
  border-color: var(--status-lopetatud-text);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.2), 0 0 20px rgba(16, 185, 129, 0.15);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-main);
}

/* Filter Row & Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  color: var(--color-text-main);
}

.filter-btn.active {
  background-color: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.search-input-wrapper {
  position: relative;
  min-width: 260px;
}

.search-input {
  width: 100%;
  background-color: var(--form-control-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  color: var(--form-control-color);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  background-color: var(--form-control-focus-bg);
}

.toolbar-right-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* View Switcher Toggle (Cards vs List) */
.view-toggle-group {
  display: flex;
  background-color: rgba(255, 255, 255, 0.04);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  gap: 0.25rem;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.view-toggle-btn:hover {
  color: var(--color-text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn.active {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Work Order List Container & Table */
.work-orders-list-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.wo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.wo-table th {
  background-color: rgba(255, 255, 255, 0.02);
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.wo-table td {
  padding: 0.9rem 1.1rem;
  color: var(--color-text-main);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

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

.wo-table-row:hover {
  background-color: var(--bg-card-hover);
}

.wo-table-row.unread-row {
  background-color: rgba(239, 68, 68, 0.07);
}

.wo-row-title-cell {
  min-width: 240px;
  max-width: 420px;
}

.wo-row-title {
  font-weight: 600;
  color: var(--color-text-main);
  font-size: 0.95rem;
  line-height: 1.35;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.wo-row-title span:first-child {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.wo-row-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  max-width: 380px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* Desktop vs Mobile list container display */
.wo-desktop-table {
  display: block;
  width: 100%;
  overflow-x: auto;
}

.wo-mobile-list {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* Mobile-specific compact list card */
.wo-mobile-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  -webkit-tap-highlight-color: transparent;
}

.wo-mobile-card:active {
  transform: scale(0.985);
  background-color: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.4);
}

.wo-mobile-card.unread-row {
  background-color: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.35);
}

.wo-mobile-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.wo-mobile-meta-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.wo-mobile-deadline {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.wo-mobile-deadline.overdue {
  color: #ef4444;
  font-weight: 600;
}

.wo-mobile-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.wo-mobile-card-desc {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.wo-mobile-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

html.light .wo-mobile-card-bottom {
  border-top-color: rgba(0, 0, 0, 0.06);
}

.wo-mobile-client {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-main);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wo-mobile-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wo-mobile-attachments {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
}

.wo-mobile-chevron {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.wo-row-client {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--color-text-main);
  white-space: nowrap;
}

.wo-assignees-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.wo-assignee-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.wo-row-deadline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--color-text-muted);
}

.wo-row-deadline.overdue {
  color: #ef4444;
  font-weight: 600;
}

.wo-row-created {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--color-text-muted);
}

.wo-row-created svg {
  flex-shrink: 0;
  color: var(--color-secondary);
}

.wo-mobile-created {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.wo-mobile-created svg {
  flex-shrink: 0;
  color: var(--color-secondary);
}

.wo-row-meta-chips {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.wo-row-action-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--color-text-main);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.wo-row-action-btn:hover {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Work Order List Grid */
.work-orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* Work Order Card */
.work-order-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-width: 0; /* Prevents card from stretching outside container on mobile */
}

.work-order-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(59, 130, 246, 0.1);
  background-color: var(--bg-card-hover);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0; /* Prevents header from stretching */
  width: 100%;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-main);
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  flex: 1;
}

.card-created-date {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.2rem 0.45rem;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-weight: 500;
  margin-top: 0.05rem;
}

.card-created-date svg {
  flex-shrink: 0;
  color: var(--color-secondary);
}

html.light .card-created-date {
  background-color: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

@media (max-width: 480px) {
  .card-created-label {
    display: none;
  }
}

.card-client {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}

.card-client span {
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.card-client-icon {
  color: var(--color-secondary);
  flex-shrink: 0;
}

.card-body {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8rem;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.4rem;
}

.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

/* Status Badges */
.badge-status-uus {
  color: var(--status-uus-text);
  background-color: var(--status-uus-bg);
  border-color: var(--status-uus-border);
}

.badge-status-ootel {
  color: var(--status-ootel-text);
  background-color: var(--status-ootel-bg);
  border-color: var(--status-ootel-border);
}

.badge-status-toos {
  color: var(--status-toos-text);
  background-color: var(--status-toos-bg);
  border-color: var(--status-toos-border);
}

.badge-status-lopetatud {
  color: var(--status-lopetatud-text);
  background-color: var(--status-lopetatud-bg);
  border-color: var(--status-lopetatud-border);
}

/* Time Spent Badge */
.badge-time-spent {
  color: var(--color-secondary);
  background-color: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.card-deadline {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Floating Action Button (FAB) */
.fab-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border: none;
  color: white;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 90;
}

.fab-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.6);
}

/* Form Controls & Styling */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.form-input,
.form-select,
.form-textarea {
  background-color: var(--form-control-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--form-control-color);
  font-size: 0.95rem;
  width: 100%;
  transition: all 0.2s;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  background-color: var(--form-control-focus-bg);
}

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

.form-select option {
  background-color: var(--select-option-bg);
  color: var(--form-control-color);
}

/* Side Panel / Overlay Drawer */
.panel-backdrop {
  position: fixed; /* Kasutame fixed positsiooni, et vältida tausta nihkumist mobiilis */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(10, 11, 15, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease-out;
  overflow: hidden; /* Takistab slaida paneelil (translateX(100%)) iOS-is horisontaalse kerimise tekitamist */
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.side-panel {
  width: 100%;
  max-width: 560px;
  height: 100%;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.panel-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.panel-close-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s;
}

.panel-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: white;
}

.panel-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  min-height: 0;
}

.side-panel form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.panel-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: rgba(0, 0, 0, 0.15);
}

/* =========================================================================
   WORK ORDER CENTERED SPACIOUS MODAL
   ========================================================================= */
.panel-backdrop.wo-modal-backdrop {
  justify-content: center !important;
  align-items: center !important;
  padding: 1.5rem !important;
  overflow-y: auto !important;
}

.side-panel.wo-modal-dialog {
  width: 100% !important;
  max-width: 1040px !important;
  height: auto !important;
  max-height: 90vh !important;
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(59, 130, 246, 0.12) !important;
  animation: modalZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.wo-modal-header {
  padding: 1.25rem 1.75rem !important;
  border-bottom: 1px solid var(--border-color) !important;
  background-color: rgba(255, 255, 255, 0.02) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.wo-modal-body {
  padding: 1.75rem !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.wo-modal-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.75rem;
  align-items: start;
}

.wo-modal-col-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wo-modal-col-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-input-lg {
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  padding: 0.75rem 1rem !important;
  border-radius: 10px !important;
}

.form-textarea-title {
  min-height: 48px;
  height: auto;
  line-height: 1.45;
  resize: vertical;
  overflow-y: hidden;
  font-size: 1.08rem !important;
  font-weight: 600 !important;
  padding: 0.65rem 0.9rem !important;
  border-radius: 10px !important;
  word-break: break-word;
  overflow-wrap: break-word;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wo-modal-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-color);
}

.wo-meta-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.time-spent-input-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.time-unit-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.wo-assignees-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wo-assignee-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.wo-assignee-label input[type="checkbox"] {
  display: none;
}

.wo-assignee-pill {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  user-select: none;
}

.wo-assignee-label:hover .wo-assignee-pill {
  border-color: rgba(96, 165, 250, 0.4);
  color: var(--color-text-main);
}

.wo-assignee-label input[type="checkbox"]:checked + .wo-assignee-pill {
  background-color: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  color: #60a5fa;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.wo-modal-footer {
  padding: 1.25rem 1.75rem !important;
  border-top: 1px solid var(--border-color) !important;
  background-color: rgba(0, 0, 0, 0.12) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.75rem !important;
  flex-shrink: 0 !important;
}

@media (max-width: 900px) {
  .panel-backdrop.wo-modal-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .side-panel.wo-modal-dialog {
    max-height: 94vh !important;
    border-radius: 16px 16px 0 0 !important;
  }

  .wo-modal-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .wo-modal-body {
    padding: 1.25rem 1rem !important;
  }

  .wo-modal-header,
  .wo-modal-footer {
    padding: 1rem 1.25rem !important;
  }

  .wo-table {
    min-width: 680px;
  }
}

/* Buttons */
.btn {
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color);
  color: var(--color-text-main);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: white;
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

/* Client Table Views */
.client-table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
}

.client-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.client-table th {
  background-color: rgba(255, 255, 255, 0.02);
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.client-table td {
  padding: 1rem 1.25rem;
  color: var(--color-text-main);
  border-bottom: 1px solid var(--border-color);
}

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

.client-table tr {
  transition: background-color 0.2s;
}

.client-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  color: var(--color-text-muted);
  gap: 1rem;
}

.empty-icon {
  font-size: 3rem;
  color: var(--color-primary);
  opacity: 0.5;
}

.empty-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.empty-text {
  max-width: 400px;
  font-size: 0.9rem;
}

/* Notifications */
.notifications-container {
  position: absolute;
  top: 1.5rem;
  left: 17.5rem; /* Positioned to the right of the sidebar on desktop */
  right: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 300;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #1c2033;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 0.95rem 1.35rem;
  border-radius: 12px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 0 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 320px;
  max-width: 480px;
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 0.92rem;
  line-height: 1.4;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

html.light .toast {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.12), 0 0 16px rgba(0, 0, 0, 0.04);
}

.toast.toast-clickable {
  cursor: pointer;
}
.toast.toast-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -4px rgba(0, 0, 0, 0.75), 0 0 25px rgba(59, 130, 246, 0.3);
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.2);
}
.toast.success svg {
  color: #10b981;
  flex-shrink: 0;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 0 20px rgba(239, 68, 68, 0.2);
}
.toast.error svg {
  color: #ef4444;
  flex-shrink: 0;
}

.toast.info {
  border-color: rgba(59, 130, 246, 0.6);
  background: linear-gradient(135deg, #1e2440 0%, #15182a 100%);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.7), 0 0 25px rgba(59, 130, 246, 0.3);
}
html.light .toast.info {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.12), 0 0 20px rgba(59, 130, 246, 0.15);
}
.toast.info svg {
  color: #38bdf8;
  flex-shrink: 0;
}

.toast.warning {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.2);
}
.toast.warning svg {
  color: #f59e0b;
  flex-shrink: 0;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Helper styles */
.read-only-info {
  margin-top: 1.5rem;
  padding: 0.75rem;
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
}

/* Mobile vs Desktop Display helpers */
.mobile-only-btn {
  display: none !important;
}

/* Charts Screen Styles */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  #root {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .app-container {
    flex-direction: column-reverse;
    /* Sidebar at bottom, content on top */
  }

  .sidebar {
    width: 100%;
    height: 64px;
    padding: 0.5rem 1rem;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    background-color: var(--bg-sidebar);
    border-right: none;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
  }

  .logo-container {
    display: none;
  }

  .nav-links {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }

  .nav-link {
    flex-direction: column;
    align-items: center;
    padding: 0.4rem;
    font-size: 0.75rem;
    gap: 0.2rem;
    text-align: center;
    width: auto;
  }

  .nav-link.active {
    border: 1px solid rgba(37, 99, 235, 0.4);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.15);
    padding: 0.4rem;
  }

  .sidebar-only-btn {
    display: none !important;
  }

  .mobile-only-btn {
    display: flex !important;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    min-width: 0;
    /* Crucial: prevents content from stretching the container horizontally */
  }

  .page-title {
    font-size: 1.4rem;
  }

  /* Compact Stats Cards on Mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .stat-card {
    padding: 0.75rem 1rem;
  }

  .stat-label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    max-width: 100%;
    overflow: hidden;
  }

  .search-input-wrapper {
    min-width: 100%;
  }

  /* Takistab iOS Safari automaatset sissesuumimist (auto-zoom) sisendväljade fookustamisel */
  .form-input,
  .form-select,
  .form-textarea,
  .search-input {
    font-size: 16px;
  }

  /* Hide Dashboard Status Filters on Mobile */
  #status-filter-row {
    display: none !important;
  }

  /* Swipeable Filters on Mobile */
  .filter-buttons {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: flex-start;
    padding-bottom: 4px;
    scrollbar-width: none;
    /* Firefox */
    width: 100%;
    max-width: 100%;
  }

  .filter-buttons::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
  }

  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    flex-shrink: 0;
    /* Prevent horizontal compression/truncation on mobile */
  }

  /* Force single column for work orders on mobile to prevent overflow */
  .work-orders-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .work-order-card {
    padding: 1.15rem 1rem;
    gap: 0.85rem;
  }

  /* Force single column for form rows on mobile */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Hide Floating Action Button (FAB) on Mobile since we have "Uus töökäsk" in the bottom tab navigation */
  .fab-btn {
    display: none;
  }

  /* Side panel mobile view */
  .side-panel {
    max-width: 100%;
    border-left: none;
  }

  .panel-header {
    padding: 1.25rem 1rem;
  }

  .panel-body {
    padding: 1.25rem 1rem;
  }

  .panel-footer {
    padding: 1rem;
  }

  /* Ensure client table retains horizontal layout and is readable when scrolled */
  .client-table {
    min-width: 650px;
  }

  /* Responsive Charts */
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .chart-container {
    height: 220px;
  }
}

/* Mileage Monthly list items */
.mileage-month-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.mileage-month-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: var(--border-glow);
}

.mileage-month-name {
  font-weight: 600;
  color: var(--color-text-main);
  text-transform: capitalize;
}

.mileage-month-val {
  font-weight: 700;
  color: var(--color-secondary);
}

/* =========================================================================
   LOGIN SCREEN STYLES
   ========================================================================= */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-login-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-login-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 
              0 0 40px rgba(59, 130, 246, 0.1);
  display: flex;
  flex-direction: column;
  animation: loginCardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.logo-icon-login {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: -0.01em;
}

.login-btn {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
}

.login-error-msg {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 1rem;
  line-height: 1.4;
  text-align: left;
}

#nav-btn-logout {
  transition: all 0.2s ease;
}

#nav-btn-logout:hover {
  background-color: rgba(239, 68, 68, 0.08) !important;
  color: #f87171 !important;
}

#mobile-btn-logout {
  display: none;
}

@media (max-width: 768px) {
  #mobile-btn-logout {
    display: inline-flex !important;
  }
}

/* =========================================================================
   THEME TOGGLE BUTTON & SMOOTH TRANSITIONS
   ========================================================================= */

/* Smooth transitions for theme-dependent properties */
body, 
.sidebar, 
.main-content,
.stat-card, 
.work-order-card, 
.client-table-container, 
.client-table td,
.client-table th,
.client-table tr,
.side-panel, 
.form-input, 
.form-select, 
.form-textarea, 
.search-input, 
.login-screen, 
.login-card, 
.btn,
.nav-link,
.panel-header,
.panel-footer,
.chart-card-wrapper,
.mileage-month-item {
  transition: background 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Theme Toggle Button Styling */
.theme-toggle-floating {
  position: fixed;
  top: 6.25rem;
  left: 4.75rem; /* Positioned below logo text inside the sidebar */
  right: auto;
  z-index: 10000; /* Float above everything including the login overlay */
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--color-text-main);
  overflow: hidden;
}

.theme-toggle-floating:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: scale(1.08) rotate(15deg);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
}

.theme-toggle-floating:active {
  transform: scale(0.95);
}

.theme-toggle-floating svg {
  position: absolute;
  width: 20px;
  height: 20px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Dark mode state (Sun visible, Moon hidden) */
.theme-toggle-floating .sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.theme-toggle-floating .moon-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

/* Light mode state (Moon visible, Sun hidden) */
html.light .theme-toggle-floating .sun-icon {
  opacity: 0;
  transform: rotate(90deg);
}

html.light .theme-toggle-floating .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

/* Mobile Position Adjustments to prevent overlap with header buttons */
@media (max-width: 768px) {
  .theme-toggle-floating {
    top: auto;
    bottom: calc(64px + 1.25rem); /* Just above the 64px bottom mobile nav bar */
    right: 1.25rem;
    left: auto;
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
    background: var(--bg-sidebar); /* More solid background on mobile overlay */
  }
  
  .theme-toggle-floating svg {
    width: 22px;
    height: 22px;
  }
}

/* Notifications Button, Badge, and Dropdown Styling */
.notifications-toggle-floating {
  position: fixed;
  top: 6.25rem;
  left: 1.5rem; /* Positioned below logo text inside the sidebar */
  right: auto;
  z-index: 10000;
  background: #181c2e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #e2e8f0;
}

html.light .notifications-toggle-floating {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #1e293b;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.notifications-toggle-floating:hover {
  background: #22273f;
  border-color: #3b82f6;
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(59, 130, 246, 0.35);
  color: #38bdf8;
}

html.light .notifications-toggle-floating:hover {
  background: #f1f5f9;
  border-color: #2563eb;
  color: #2563eb;
}

.notifications-toggle-floating.has-unread {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4), 0 4px 15px rgba(0, 0, 0, 0.35);
  color: #38bdf8;
}

.notifications-toggle-floating:active {
  transform: scale(0.95);
}

@keyframes bellRing {
  0% { transform: scale(1) rotate(0); }
  15% { transform: scale(1.15) rotate(14deg); }
  30% { transform: scale(1.15) rotate(-14deg); }
  45% { transform: scale(1.15) rotate(10deg); }
  60% { transform: scale(1.15) rotate(-10deg); }
  75% { transform: scale(1.05) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f1117;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.9);
  animation: pulse-red 2s infinite;
}

html.light .notification-badge {
  border-color: #ffffff;
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.notifications-dropdown {
  position: fixed;
  top: 9.5rem;
  left: 1.5rem; /* Align dropdown underneath the sidebar notifications button */
  right: auto;
  z-index: 10000;
  width: 350px;
  max-height: 440px;
  background: linear-gradient(180deg, #1f243c 0%, #171a2b 100%);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 14px;
  box-shadow: 0 24px 48px -6px rgba(0, 0, 0, 0.8), 0 0 25px rgba(59, 130, 246, 0.15);
  overflow-y: auto;
  display: none;
  flex-direction: column;
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

html.light .notifications-dropdown {
  background: #ffffff;
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 20px 45px -5px rgba(0, 0, 0, 0.16), 0 0 20px rgba(59, 130, 246, 0.08);
}

/* Custom scrollbar for notifications dropdown */
.notifications-dropdown::-webkit-scrollbar {
  width: 6px;
}
.notifications-dropdown::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.notifications-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

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

.notifications-header {
  padding: 0.95rem 1.15rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

html.light .notifications-header {
  background: rgba(241, 245, 249, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.notifications-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

html.light .notifications-title {
  color: #0f172a;
}

.notifications-list {
  display: flex;
  flex-direction: column;
}

.notification-item {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  text-align: left;
  position: relative;
  background: transparent;
}

html.light .notification-item {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.notification-item:hover {
  background-color: rgba(59, 130, 246, 0.12);
  padding-left: 1.3rem;
}

html.light .notification-item:hover {
  background-color: rgba(59, 130, 246, 0.08);
}

.notification-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #3b82f6;
  opacity: 0.9;
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
}

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

.notification-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.notification-item-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: #f8fafc;
  line-height: 1.35;
}

html.light .notification-item-title {
  color: #0f172a;
}

.notification-item-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.45rem;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 4px;
}

.notification-item-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}

html.light .notification-item-desc {
  color: #64748b;
}

.notification-item-time {
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.notification-empty {
  padding: 2.2rem 1.2rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .notifications-toggle-floating {
    top: auto;
    bottom: calc(64px + 1.25rem);
    right: 5rem;
    left: auto;
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
    background: #181c2e;
  }
  
  html.light .notifications-toggle-floating {
    background: #ffffff;
  }
  
  .notifications-dropdown {
    position: fixed;
    top: auto;
    bottom: calc(64px + 1.25rem + 60px);
    right: 1.25rem;
    left: 1.25rem;
    width: auto;
    max-height: 350px;
  }
}

/* Unread work order card highlighting */
.work-order-card.unread-card {
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.08) !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.02) 0%, var(--bg-card) 100%) !important;
}

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

/* =========================================================================
   PILTIDE ÜLESLAADIMINE JA EELVAATE STIILID
   ========================================================================= */

.image-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background-color: var(--form-control-bg);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  margin-top: 0.25rem;
}

.image-upload-zone:hover {
  border-color: var(--color-primary);
  color: var(--color-text-main);
  background-color: var(--form-control-focus-bg);
}

.images-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 500px) {
  .images-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.preview-image-wrapper {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.2);
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.preview-image:hover {
  transform: scale(1.05);
}

.delete-image-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 5;
  transition: background 0.2s;
  line-height: 1;
}

.delete-image-btn:hover {
  background: rgb(220, 38, 38);
}

.image-uploading-spinner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 17, 23, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

.image-uploading-spinner .spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

/* Light Mode Overrides for Image Upload Zone */
html.light .image-upload-zone {
  border-color: rgba(0, 0, 0, 0.15);
}

html.light .image-upload-zone:hover {
  border-color: var(--color-primary);
  background-color: rgba(0, 0, 0, 0.02);
}

.btn-delete-mileage-row:hover {
  color: #ef4444 !important;
}

/* =========================================================================
   DOKUMENTIDE ÜLESLAADIMINE JA LOENDI STIILID
   ========================================================================= */

.document-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background-color: var(--form-control-bg);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  margin-top: 0.25rem;
}

.document-upload-zone:hover {
  border-color: var(--color-primary);
  color: var(--color-text-main);
  background-color: var(--form-control-focus-bg);
}

html.light .document-upload-zone {
  border-color: rgba(0, 0, 0, 0.15);
}

html.light .document-upload-zone:hover {
  border-color: var(--color-primary);
  background-color: rgba(0, 0, 0, 0.02);
}

.documents-preview-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.preview-document-item:hover {
  border-color: var(--color-primary-light);
  background-color: rgba(96, 165, 250, 0.05);
}

.document-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.document-icon {
  flex-shrink: 0;
  color: var(--color-primary);
  display: flex;
  align-items: center;
}

.document-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-main);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-name:hover {
  text-decoration: underline;
}

.delete-document-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.delete-document-btn:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.document-uploading-spinner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.document-uploading-spinner .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* =========================================================================
   WORK ORDER TIMER & STOPPER STYLES
   ========================================================================= */

/* Global Active Timer Bar */
.active-timer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.08) 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  gap: 1rem;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.15), inset 0 0 8px rgba(239, 68, 68, 0.03);
  backdrop-filter: blur(10px);
  animation: timerPulseGlow 3s infinite alternate, timerSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

@keyframes timerPulseGlow {
  0% {
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.12), inset 0 0 6px rgba(239, 68, 68, 0.02);
    border-color: rgba(239, 68, 68, 0.3);
  }
  100% {
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.28), inset 0 0 10px rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.5);
  }
}

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

.timer-bar-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text-main);
  font-weight: 600;
  font-size: 0.95rem;
}

.timer-pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #ef4444;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: timerPulseEffect 1.8s infinite;
}

@keyframes timerPulseEffect {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 7px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.timer-bar-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-timer-bar-view,
.btn-timer-bar-stop {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  height: auto;
  border-radius: 6px;
  text-transform: none;
  letter-spacing: normal;
}

.btn-timer-bar-view {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--color-text-main);
}

.btn-timer-bar-view:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-timer-bar-stop {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-timer-bar-stop:hover {
  background-color: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

/* Light mode modifications for timer bar */
html.light .active-timer-bar {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.04) 0%, rgba(220, 38, 38, 0.04) 100%);
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.06);
}

html.light .btn-timer-bar-view {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

html.light .btn-timer-bar-view:hover {
  background-color: #f8fafc;
}

/* Drawer Timer Card */
.timer-controls-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  gap: 1rem;
  flex-wrap: wrap;
  transition: all 0.2s ease;
}

.timer-status-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timer-display-val {
  font-family: 'DM Sans', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: 0.5px;
}

.timer-action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-timer-start,
.btn-timer-stop {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  height: auto;
  border-radius: 6px;
}

.btn-timer-start {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.btn-timer-start:hover {
  background-color: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
}

.btn-timer-stop {
  background-color: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.btn-timer-stop:hover {
  background-color: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
}

.timer-status-msg {
  width: 100%;
  font-size: 0.85rem;
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Light mode overrides for Drawer Timer Card */
html.light .timer-controls-card {
  background-color: #f8fafc;
}

@media (max-width: 768px) {
  .active-timer-bar {
    margin-right: 0;
  }
  .notifications-container {
    right: 1.5rem;
    left: auto; /* Reset left positioning on mobile */
  }
}

/* Accessibility: prefers-reduced-motion overrides */
@media (prefers-reduced-motion: reduce) {
  .active-timer-bar {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
  
  .timer-pulse-dot,
  #wo-timer-pulse {
    animation: none !important;
    box-shadow: none !important;
    opacity: 0.8;
  }
  
  .toast {
    animation: none !important;
  }
}

/* Sidebar New Work Order Button */
.btn-sidebar-add-wo {
  margin-top: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #1d4ed8 100%);
  color: #ffffff !important;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  font-size: 0.95rem;
  text-align: center;
  box-sizing: border-box;
}

.btn-sidebar-add-wo:hover {
  background: linear-gradient(135deg, #3b82f6 0%, var(--color-primary) 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sidebar-add-wo:active {
  transform: translateY(0.5px);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.btn-sidebar-add-wo svg {
  stroke: #ffffff;
}

/* Light mode overrides */
html.light .btn-sidebar-add-wo {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

/* =========================================================================
   KLIENTIDE KAARDID, VAATED JA DOKUMENTIDE PILVE TÄIENDUS
   ========================================================================= */

/* Client Cards Grid Layout */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

/* Client Card Style */
.client-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.client-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(59, 130, 246, 0.1);
  background-color: var(--bg-card-hover);
}

.client-card-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-main);
  margin: 0;
  padding-right: 3.25rem; /* Ennetab teksti kattumist pilve ikooniga */
  overflow-wrap: break-word;
}

.client-card-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.client-card-detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.client-card-detail-item svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.client-card-detail-item a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.client-card-detail-item a:hover {
  color: var(--color-primary);
}

.client-card-stats {
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.client-card-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.client-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

/* View Switcher toggle style */
.view-switcher-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--form-control-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
}

.view-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.view-btn:hover {
  color: var(--color-text-main);
}

.view-btn.active {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* Tabs for Drawer */
.drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
  gap: 0.25rem;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  outline: none;
}

.tab-btn:hover {
  color: var(--color-text-main);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.25s ease-out;
}

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

/* Client Header Profile Card inside drawer */
.client-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.client-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50px;
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  flex-shrink: 0;
}

.client-profile-info {
  min-width: 0;
  flex: 1;
}

.client-profile-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text-main);
  margin: 0 0 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-profile-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Client Card Cloud Glowing Badge */
.client-card-cloud-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.01);
}

.client-card-cloud-badge.has-files {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.05) 100%);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--color-primary);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.18), inset 0 0 4px rgba(59, 130, 246, 0.1);
  animation: cloudPulse 3s infinite ease-in-out;
}

.client-card:hover .client-card-cloud-badge.has-files {
  transform: scale(1.08) rotate(3deg);
  background: linear-gradient(135deg, var(--color-primary) 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.45);
}

.cloud-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
  transition: border-color 0.25s, transform 0.25s;
  box-sizing: content-box;
}

.client-card:hover .cloud-count-badge {
  border-color: #1d4ed8;
  transform: scale(1.05);
}

@keyframes cloudPulse {
  0% { box-shadow: 0 0 12px rgba(59, 130, 246, 0.15); }
  50% { box-shadow: 0 0 16px rgba(59, 130, 246, 0.28); }
  100% { box-shadow: 0 0 12px rgba(59, 130, 246, 0.15); }
}

/* =========================================================================
   CALENDAR BUTTON & SPLIT DROPDOWN STYLES
   ========================================================================= */

.calendar-action-group {
  display: inline-flex;
  position: relative;
  vertical-align: middle;
  align-items: stretch;
}

.calendar-main-btn {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  padding-right: 0.75rem !important;
  gap: 0.4rem !important;
}

.calendar-split-btn {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
  padding: 0 0.55rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

html.light .calendar-split-btn {
  border-left: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.calendar-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 1050;
  backdrop-filter: blur(12px);
  animation: fadeInCalendarMenu 0.15s ease-out;
}

html.light .calendar-menu {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

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

.calendar-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--color-text-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.calendar-menu-item svg {
  flex-shrink: 0;
  color: var(--color-primary);
}

.calendar-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

html.light .calendar-menu-item {
  color: #1e293b;
}

html.light .calendar-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

.calendar-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.25rem 0;
}

/* =========================================================================
   LIGHT THEME OVERRIDES FOR WORK ORDERS LIST & SPACIOUS MODAL
   ========================================================================= */
html.light .view-toggle-group {
  background-color: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

html.light .view-toggle-btn {
  color: var(--color-text-muted);
}

html.light .view-toggle-btn:hover {
  color: var(--color-text-main);
  background-color: rgba(0, 0, 0, 0.05);
}

html.light .view-toggle-btn.active {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

html.light .work-orders-list-container {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

html.light .wo-table th {
  background-color: rgba(0, 0, 0, 0.02);
  color: #64748b;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html.light .wo-table td {
  color: #0f172a;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

html.light .wo-table-row:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

html.light .wo-table-row.unread-row {
  background-color: rgba(239, 68, 68, 0.04);
}

html.light .wo-row-action-btn {
  background-color: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}

html.light .wo-row-action-btn:hover {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

html.light .side-panel.wo-modal-dialog {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.18), 0 0 30px rgba(37, 99, 235, 0.06) !important;
}

html.light .wo-modal-header {
  background-color: rgba(0, 0, 0, 0.015) !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

html.light .wo-modal-footer {
  background-color: #f8fafc !important;
  border-top-color: rgba(0, 0, 0, 0.08) !important;
}

html.light .wo-meta-card {
  background-color: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.08);
}

html.light .wo-assignee-pill {
  background-color: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}

html.light .wo-assignee-label:hover .wo-assignee-pill {
  border-color: rgba(37, 99, 235, 0.4);
  color: #0f172a;
}

html.light .wo-assignee-label input[type="checkbox"]:checked + .wo-assignee-pill {
  background-color: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.4);
  color: #1d4ed8;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.15);
}

html.light .wo-assignee-mini-chip {
  background-color: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.2);
}

/* =========================================================================
   ACCESSIBILITY & REDUCED MOTION SUPPORT (WCAG AA & IMPECCABLE COMPLIANCE)
   ========================================================================= */
.view-toggle-btn:active,
.wo-row-action-btn:active,
.wo-assignee-pill:active {
  transform: scale(0.98);
}

.view-toggle-btn:focus-visible,
.wo-row-action-btn:focus-visible,
.wo-table-row:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .side-panel.wo-modal-dialog,
  .view-toggle-btn,
  .wo-table-row,
  .wo-assignee-pill,
  .wo-row-action-btn,
  .panel-backdrop {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* Mobile specific overrides for list view */
@media (max-width: 768px) {
  .wo-desktop-table {
    display: none !important;
  }

  .wo-mobile-list {
    display: flex !important;
  }

  .work-orders-list-container {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-bottom: 5.5rem !important;
  }

  .toolbar-right-group {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }

  .search-input-wrapper {
    flex: 1;
    min-width: 0;
  }

  .view-toggle-btn {
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
  }
}