/* =========================================================
   FACILITYPLUS — LIQUID GLASS DESIGN SYSTEM
   Inspired by Apple visionOS / iOS 26 Liquid Glass
========================================================= */

:root {
  /* Brand */
  --primary: #ff3347;
  --primary-dim: rgba(255, 51, 71, 0.75);
  --primary-glass: rgba(255, 51, 71, 0.18);
  --primary-subtle: rgba(255, 51, 71, 0.1);
  --primary-glow: 0 8px 32px rgba(255, 51, 71, 0.4);
  --primary-glow-strong: 0 16px 48px rgba(255, 51, 71, 0.55);

  /* Glass surfaces */
  --glass-4: rgba(255, 255, 255, 0.04);
  --glass-8: rgba(255, 255, 255, 0.08);
  --glass-12: rgba(255, 255, 255, 0.12);
  --glass-18: rgba(255, 255, 255, 0.18);
  --glass-24: rgba(255, 255, 255, 0.24);

  /* Glass borders */
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glass-mid: rgba(255, 255, 255, 0.16);
  --border-glass-strong: rgba(255, 255, 255, 0.22);
  --border-primary: rgba(255, 51, 71, 0.35);

  /* Blur filters */
  --blur-sm: blur(16px) saturate(160%);
  --blur-md: blur(32px) saturate(180%);
  --blur-lg: blur(56px) saturate(200%);
  --blur-xl: blur(80px) saturate(220%);

  /* Specular highlight — Apple Liquid Glass top-edge shimmer */
  --specular:
    inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1px 0 rgba(0, 0, 0, 0.1);

  /* Text */
  --text: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.58);
  --text-tertiary: rgba(255, 255, 255, 0.34);

  /* Status (Apple system palette) */
  --success: #30d158;
  --success-glass: rgba(48, 209, 88, 0.18);
  --warning: #ffd60a;
  --warning-glass: rgba(255, 214, 10, 0.18);
  --danger: #ff453a;
  --danger-glass: rgba(255, 69, 58, 0.18);
  --info: #0a84ff;
  --info-glass: rgba(10, 132, 255, 0.18);

  /* Shadows */
  --shadow-card: 0 24px 72px rgba(0, 0, 0, 0.55), var(--specular);
  --shadow-card-hover: 0 36px 96px rgba(0, 0, 0, 0.65), var(--specular);
  --shadow-panel: 0 40px 100px rgba(0, 0, 0, 0.6), var(--specular);
  --shadow-sidebar: 20px 0 80px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 48px 120px rgba(0, 0, 0, 0.7), var(--specular);

  /* Radii */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-2xl: 40px;

  /* Legacy compatibility aliases */
  --bg: #0b0d16;
  --surface: var(--glass-12);
  --surface-strong: var(--glass-18);
  --surface-muted: var(--primary-subtle);
  --muted: var(--text-secondary);
  --border: var(--border-glass);
  --primary-strong: #e8001a;
  --primary-soft: var(--primary-glass);
  --shadow: var(--shadow-card);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* =========================================================
   RESET
========================================================= */

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

*,
*::before,
*::after {
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease;
}

a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}
textarea {
  resize: vertical;
}

label {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* =========================================================
   BODY — IMMERSIVE BACKGROUND
========================================================= */

html,
body {
  min-height: 100%;
  font-family:
    -apple-system, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(
      ellipse 80% 60% at 10% -10%,
      rgba(160, 0, 50, 0.45) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 70% 50% at 90% 5%,
      rgba(15, 25, 80, 0.55) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 90% 70% at 50% 110%,
      rgba(5, 8, 40, 0.7) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 60% 40% at 20% 80%,
      rgba(20, 0, 60, 0.35) 0%,
      transparent 50%
    ),
    linear-gradient(180deg, #0c0e1e 0%, #08090f 100%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Animated glass orbs in background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle 500px at 15% 20%,
      rgba(255, 51, 71, 0.12),
      transparent
    ),
    radial-gradient(
      circle 400px at 80% 15%,
      rgba(100, 50, 200, 0.1),
      transparent
    ),
    radial-gradient(
      circle 600px at 50% 80%,
      rgba(0, 30, 100, 0.15),
      transparent
    );
  z-index: -1;
}

/* =========================================================
   FORM ELEMENTS
========================================================= */

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--primary-glow);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

button:hover {
  transform: translateY(-2px);
  background: var(--primary-dim);
  box-shadow: var(--primary-glow-strong);
}

input,
select,
textarea {
  border: 1px solid var(--border-glass-mid);
  border-radius: var(--r-md);
  background: rgba(18, 20, 38, 0.85);
  color: var(--text);
  backdrop-filter: var(--blur-sm);
}

select option {
  background: #12142a;
  color: rgba(255, 255, 255, 0.92);
}

input::placeholder {
  color: var(--text-tertiary);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-primary);
  background: rgba(22, 24, 48, 0.95);
  box-shadow: 0 0 0 4px rgba(255, 51, 71, 0.15);
}

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  width: 280px;
  height: 100vh;
  flex-shrink: 0;
  background: rgba(10, 12, 25, 0.8);
  -webkit-backdrop-filter: var(--blur-lg);
  backdrop-filter: var(--blur-lg);
  color: var(--text);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-right: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sidebar);
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
  position: relative;
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.14),
    transparent
  );
  pointer-events: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-logo,
.login-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-logo img,
.login-logo img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(255, 51, 71, 0.3));
}

/* =========================================================
   SIDEBAR NAV
========================================================= */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  margin-top: 24px;
}

.sidebar-nav a {
  color: var(--text-secondary);
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  background: var(--glass-4);
  border: 1px solid var(--border-glass);
  min-height: 50px;
  opacity: 0;
  transform: translateX(-8px);
  animation: slide-in 0.32s ease forwards;
}

.sidebar-nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--specular);
  pointer-events: none;
  border-radius: inherit;
}

.sidebar-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;
  width: 3px;
  height: 80%;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
  transform: translateX(-200%);
  opacity: 0;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.sidebar-nav a:nth-child(1) {
  animation-delay: 0.06s;
}
.sidebar-nav a:nth-child(2) {
  animation-delay: 0.12s;
}
.sidebar-nav a:nth-child(3) {
  animation-delay: 0.18s;
}
.sidebar-nav a:nth-child(4) {
  animation-delay: 0.24s;
}
.sidebar-nav a:nth-child(5) {
  animation-delay: 0.3s;
}
.sidebar-nav a:nth-child(6) {
  animation-delay: 0.36s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--primary-glass);
  color: var(--text);
  border-color: var(--border-primary);
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(255, 51, 71, 0.15);
}

.sidebar-nav a:hover::after,
.sidebar-nav a.active::after {
  transform: translateX(0);
  opacity: 1;
}

.sidebar-nav a.active {
  background: rgba(255, 51, 71, 0.22);
}

/* =========================================================
   NAV DROPDOWN
========================================================= */

.admin-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-glass);
}

.admin-dropdown,
.nav-dropdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-dropdown-toggle,
.nav-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--glass-4);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  letter-spacing: 0.02em;
}

.admin-dropdown-toggle:hover,
.nav-dropdown-toggle:hover {
  background: var(--primary-glass);
  border-color: var(--border-primary);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.admin-dropdown-chevron,
.nav-dropdown-chevron {
  font-size: 18px;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.admin-dropdown.open .admin-dropdown-chevron,
.nav-dropdown.open .nav-dropdown-chevron {
  transform: rotate(90deg);
}

.nav-dropdown-icon {
  font-size: 15px;
  display: flex;
  align-items: center;
}
.nav-dropdown-label {
  flex: 1;
  text-align: left;
}

.admin-dropdown-menu,
.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding-left: 6px;
  animation: slideDown 0.2s ease forwards;
  background: transparent;
}

.admin-dropdown.open .admin-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
}

.admin-dropdown-menu a,
.nav-dropdown-menu a,
.nav-dropdown-item {
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--glass-4);
  border: 1px solid var(--border-glass);
}

.admin-dropdown-menu a:hover,
.nav-dropdown-menu a:hover,
.nav-dropdown-item:hover {
  background: var(--primary-glass);
  border-color: var(--border-primary);
  color: var(--text);
  transform: translateX(4px);
}

.admin-dropdown-menu a.active,
.nav-dropdown-menu a.active,
.nav-dropdown-item.active {
  background: rgba(255, 51, 71, 0.22);
  border-color: var(--border-primary);
  color: var(--text);
}

/* =========================================================
   SIDEBAR FOOTER
========================================================= */

.sidebar-footer {
  margin-top: 24px;
  display: grid;
  gap: 10px;
}

.sidebar-footer button {
  width: 100%;
  padding: 13px;
  border-radius: var(--r-md);
  background: rgba(255, 51, 71, 0.22);
  color: var(--text);
  font-weight: 700;
  box-shadow: none;
  border: 1px solid var(--border-primary);
}

.sidebar-footer button:hover {
  background: var(--primary);
  box-shadow: var(--primary-glow);
  transform: translateY(-1px);
}

.user-box {
  background: var(--glass-8);
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-glass-mid);
  box-shadow: var(--specular);
  -webkit-backdrop-filter: var(--blur-sm);
  backdrop-filter: var(--blur-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-box .user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.user-box .user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.user-box .user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-box .user-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.role-badge {
  background: var(--primary-glass);
  color: var(--primary);
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 51, 71, 0.25);
  white-space: nowrap;
}

.version-link {
  display: block;
  margin-top: 12px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.03em;
}

.version-link:hover {
  color: var(--text-secondary);
}

.studio-selector,
.c-select.studio-selector {
  width: clamp(120px, 18vw, 240px);
  max-width: 100%;
  flex-shrink: 0;
}

.c-select.studio-selector .c-select__trigger {
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}

/* Fallback for non-JS environments */
select.studio-selector {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
}

select option {
  background: #12142a;
  color: rgba(255, 255, 255, 0.92);
}

/* =========================================================
   MAIN CONTAINERS
========================================================= */

.dashboard,
.infoboard,
.users,
.maintenance,
.inventory,
.tasks,
.technician,
.logistics,
.locations,
.user-settings,
.contacts,
.time-tracking {
  flex: 1;
  height: 100vh;
  padding: 36px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid var(--border-glass);
  border-left: none;
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
  box-shadow: inset 1px 0 0 var(--border-glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* =========================================================
   CARDS & PANELS
========================================================= */

.card,
.panel {
  background: var(--glass-8);
  padding: 28px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-glass-mid);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: var(--blur-md);
  backdrop-filter: var(--blur-md);
  position: relative;
  overflow: hidden;
}

.card::before,
.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  pointer-events: none;
}

.card:hover,
.panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-glass-strong);
}

.card h3 {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

/* =========================================================
   DASHBOARD SPECIFIC
========================================================= */

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 24px 28px;
  border-radius: var(--r-xl);
  background: var(--glass-8);
  border: 1px solid var(--border-glass-mid);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: var(--blur-md);
  backdrop-filter: var(--blur-md);
  position: relative;
  overflow: hidden;
}

.dashboard-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
}

.dashboard-header h1 {
  font-size: 32px;
  margin-bottom: 6px;
  font-weight: 800;
}
.dashboard-header p {
  color: var(--text-secondary);
}

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

.performance-panel {
  margin-bottom: 32px;
  padding: 26px;
  border-radius: var(--r-xl);
  background: var(--glass-8);
  border: 1px solid var(--border-glass-mid);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: var(--blur-md);
  backdrop-filter: var(--blur-md);
  position: relative;
  overflow: hidden;
}

.performance-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.18),
    transparent
  );
}

.performance-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.performance-header h2 {
  font-size: 20px;
  margin-bottom: 6px;
}
.performance-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.performance-score {
  min-width: 90px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--primary-glass);
  color: var(--primary);
  text-align: center;
  border: 1px solid rgba(255, 51, 71, 0.25);
}

.performance-score span {
  display: block;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}
.performance-score small {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.performance-chart-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.performance-chart-wrap::-webkit-scrollbar {
  display: none;
}
.performance-chart {
  width: 100%;
  min-width: 620px;
  height: 220px;
  display: block;
}

.performance-grid-line {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
}
.performance-axis-label,
.performance-day-label {
  fill: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}
.performance-value-label {
  fill: var(--text);
  font-size: 12px;
  font-weight: 900;
}
.performance-area {
  fill: rgba(255, 51, 71, 0.12);
}
.performance-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.performance-point {
  fill: #fff;
  stroke: var(--primary);
  stroke-width: 3;
}
.performance-point-empty {
  fill: var(--glass-18);
  stroke: var(--border-glass-strong);
  stroke-width: 2;
}

.performance-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.performance-day {
  padding: 10px;
  border-radius: var(--r-sm);
  background: var(--glass-4);
  border: 1px solid var(--border-glass);
  text-align: center;
}

.performance-day span {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}
.performance-day strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
}

.dashboard-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.panel h2 {
  font-size: 20px;
  margin-bottom: 18px;
}

.task-list li,
.material-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--glass-4);
  border: 1px solid var(--border-glass);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
}

.dashboard-list-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--glass-8);
  font-size: 20px;
  border: 1px solid var(--border-glass);
}

.dashboard-list-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}
.dashboard-list-icon-emoji {
  font-size: 20px;
}

/* =========================================================
   TOAST NOTIFICATIONS
========================================================= */

.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: var(--blur-md);
  backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
  pointer-events: auto;
  animation: fade-in-up 0.32s ease both;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: linear-gradient(
    135deg,
    rgba(48, 209, 88, 0.85),
    rgba(20, 160, 60, 0.85)
  );
}
.toast-warning {
  background: linear-gradient(
    135deg,
    rgba(255, 214, 10, 0.85),
    rgba(200, 160, 0, 0.85)
  );
}
.toast-danger,
.toast-error {
  background: linear-gradient(
    135deg,
    rgba(255, 69, 58, 0.85),
    rgba(200, 30, 20, 0.85)
  );
}
.toast-info {
  background: linear-gradient(
    135deg,
    rgba(10, 132, 255, 0.85),
    rgba(0, 80, 200, 0.85)
  );
}

.toast-confirm {
  min-width: 320px;
  pointer-events: auto;
}
.toast-confirm-message {
  margin-bottom: 12px;
  line-height: 1.5;
}
.toast-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.toast-confirm-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.toast-confirm-yes {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.toast-confirm-no {
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.75);
}
.toast-confirm-btn:hover {
  transform: none;
  opacity: 0.85;
}

/* =========================================================
   MODALS (shared — used across all pages)
========================================================= */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.modal.show {
  display: flex;
}

body:has(.modal.show) main {
  overflow: hidden;
}

.modal-content {
  background: var(--glass-12);
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--r-2xl);
  padding: 32px;
  max-width: 560px;
  width: 100%;
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  -webkit-backdrop-filter: var(--blur-xl);
  backdrop-filter: var(--blur-xl);
  position: relative;
  animation: scale-in 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-glass-mid) transparent;
}

.modal-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    transparent
  );
  pointer-events: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 800;
}

.modal-header button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-8);
  border: 1px solid var(--border-glass-mid);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  box-shadow: none;
}

.modal-header button:hover {
  background: var(--danger-glass);
  border-color: rgba(255, 69, 58, 0.25);
  color: var(--danger);
  transform: none;
  box-shadow: none;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-content label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  padding: 12px 14px;
  border: 1px solid var(--border-glass-mid);
  border-radius: var(--r-sm);
  background: var(--glass-8);
  color: var(--text);
  font: inherit;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
  border-color: var(--border-primary);
  background: var(--glass-12);
  box-shadow: 0 0 0 3px rgba(255, 51, 71, 0.15);
}

.modal-content button[type="submit"] {
  margin-top: 4px;
  padding: 13px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  box-shadow: var(--primary-glow);
}

.modal-content button[type="submit"]:hover {
  box-shadow: var(--primary-glow-strong);
}

.reset-tutorial-btn {
  width: 100%;
  padding: 11px;
  border-radius: var(--r-md);
  background: var(--glass-8);
  border: 1px solid var(--border-glass-mid);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}

.reset-tutorial-btn:hover {
  background: var(--glass-12);
  color: var(--text);
}

/* Card color variants (used by techniker, logistik, etc.) */
.warning-card {
  border-top: 3px solid var(--warning);
}
.success-card {
  border-top: 3px solid var(--success);
}

/* =========================================================
   LOADING SPINNER
========================================================= */

.loading-overlay,
.toast {
  animation: fade-in-up 0.32s ease both;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 15, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 2200;
  border-radius: inherit;
}

.loading-overlay--fixed {
  position: fixed;
  border-radius: 0;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 5px solid var(--glass-12);
  border-top-color: var(--primary);
  box-shadow: 0 0 20px rgba(255, 51, 71, 0.25);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  z-index: 2201;
  animation: spin 900ms linear infinite;
}

.loading-spinner--fixed {
  position: fixed;
}
.loading-spinner--absolute {
  position: absolute;
}
.content-with-spinner {
  position: relative;
}

/* =========================================================
   MOBILE TOPBAR
========================================================= */

.mobile-menu-btn {
  display: none;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border-radius: var(--r-md);
  font-size: 24px;
  line-height: 1;
  z-index: 1200;
  background: var(--glass-8);
  border: 1px solid var(--border-glass-mid);
  box-shadow: none;
  color: var(--text);
}

.mobile-topbar,
.sidebar-overlay {
  display: none;
}

.mobile-topbar-logo {
  display: flex;
  align-items: center;
  min-width: 0;
}

.mobile-topbar-logo img {
  width: 120px;
  height: 90px;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(255, 51, 71, 0.25));
}

/* =========================================================
   INVITATION NOTICE
========================================================= */

.invitation-notice {
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--glass-8);
  border: 1px solid var(--border-glass-mid);
}

/* =========================================================
   SETTINGS LINK
========================================================= */

.settings-link {
  color: var(--text-secondary);
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  background: var(--glass-4);
  border: 1px solid var(--border-glass);
  margin-top: 6px;
}

.settings-link::before {
  content: "\2699\FE0F";
  font-size: 15px;
}

.settings-link:hover,
.settings-link.active {
  background: var(--primary-glass);
  border-color: var(--border-primary);
  color: var(--text);
  transform: translateX(4px);
}

/* =========================================================
   CUSTOM SELECT
========================================================= */

.c-select {
  display: block;
  width: 100%;
  position: relative;
}

.c-select__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(15, 17, 35, 0.88);
  border: 1px solid var(--border-glass-mid);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.c-select__trigger:hover {
  border-color: var(--border-glass-strong);
  background: rgba(22, 24, 48, 0.94);
  transform: none;
  box-shadow: none;
}

.c-select.open .c-select__trigger,
.c-select__trigger:focus-visible {
  border-color: var(--border-primary);
  background: rgba(22, 24, 48, 0.96);
  box-shadow: 0 0 0 3px rgba(255, 51, 71, 0.15);
  outline: none;
}

.c-select.disabled .c-select__trigger {
  opacity: 0.45;
  cursor: not-allowed;
}

.c-select__label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.c-select__arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition:
    transform 0.22s ease,
    color 0.22s ease;
  display: flex;
  align-items: center;
}

.c-select__arrow svg {
  width: 100%;
  height: 100%;
  display: block;
}

.c-select.open .c-select__arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

/* Menu is appended to <body> and uses position:fixed */

.c-select__menu {
  position: fixed;
  z-index: 9999;
  background: rgba(10, 12, 26, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-md);
  padding: 6px;
  -webkit-backdrop-filter: blur(48px) saturate(200%);
  backdrop-filter: blur(48px) saturate(200%);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-glass-mid) transparent;
  animation: scale-in 0.16s ease both;
  transform-origin: top center;
  width: auto !important;
}

.c-select__option {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 0.14s ease,
    color 0.14s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.c-select__option::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  transition: background 0.14s ease;
}

.c-select__option:hover {
  background: var(--glass-8);
  color: var(--text);
}

.c-select__option.selected {
  background: var(--primary-glass);
  color: var(--primary);
  font-weight: 700;
}

.c-select__option.selected::before {
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}

.c-select__option.selected:hover {
  background: rgba(255, 51, 71, 0.26);
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  body {
    flex-direction: column;
    height: auto;
    min-height: auto;
    padding-top: 76px;
  }

  .sidebar {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100vw;
    height: calc(100dvh - 76px);
    min-width: auto;
    padding: 20px 18px;
    transform: translateX(-110%);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1100;
    border-radius: 0 var(--r-xl) var(--r-xl) 0;
    box-shadow:
      24px 0 80px rgba(255, 51, 71, 0.15),
      var(--shadow-sidebar);
  }

  .sidebar.show {
    transform: translateX(0);
  }
  .sidebar-logo {
    display: none;
  }

  .mobile-topbar {
    position: fixed;
    inset: 0 0 auto;
    height: 76px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(10, 12, 25, 0.85);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: var(--blur-md);
    backdrop-filter: var(--blur-md);
    z-index: 1200;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
  }

  .mobile-menu-btn {
    display: flex;
  }

  .dashboard,
  .infoboard,
  .users,
  .maintenance,
  .inventory,
  .tasks,
  .technician,
  .logistics,
  .locations,
  .user-settings,
  .contacts,
  .time-tracking {
    width: 100%;
    min-height: calc(100dvh - 76px) !important;
    height: auto;
    padding-top: 28px;
    border-radius: 0;
    border-left: 1px solid var(--border-glass);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 76px 0 0;
    display: none;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 1000;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .user-box {
    padding: 6px 8px;
  }
  .user-box .user-avatar {
    width: 38px;
    height: 38px;
  }
  .user-box .user-name {
    font-size: 12px;
  }
  .studio-selector {
    width: clamp(100px, 38vw, 200px);
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 68px;
  }

  .mobile-topbar {
    height: 68px;
    padding: 10px 14px;
    border-radius: 0 0 var(--r-md) var(--r-md);
  }

  .mobile-topbar-logo img {
    width: 110px;
    max-height: 76px;
  }

  .mobile-menu-btn {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }

  .sidebar {
    top: 68px;
    width: 100vw !important;
    height: calc(100dvh - 68px);
  }

  .sidebar-overlay {
    inset: 68px 0 0;
  }

  .data-user-name {
    display: none;
  }
}

@media (max-width: 1000px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-content {
    grid-template-columns: 1fr;
  }
  .performance-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .dashboard {
    padding: 22px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .cards {
    grid-template-columns: 1fr;
  }
  .performance-panel {
    display: none;
  }
  .performance-header {
    flex-direction: column;
    align-items: stretch;
  }
  .performance-score {
    width: 100%;
  }
  .performance-days {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
