/* ═══════════════════════════════════════════════════════════════
   Digital Housekeeping System — MC Design System
   Glassmorphism matching mc.gensqq.cfd
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --violet: #8B5CF6;
  --violet-glow: #A78BFA;
  --cyan: #7DD3FC;
  --mint: #5EE2B5;
  --amber: #F5B544;
  --red: #F26D6D;
  --pink: #F472B6;
  --gold: #FBBF24;
  --magenta: #E879F9;
  --text: #F4F4F8;
  --muted: #8A8A9B;

  --bg: #15151F;
  --glass: rgba(31,31,43,0.55);
  --glass-solid: rgba(31,31,43,1);
  --glass-border: rgba(255,255,255,0.06);
  --glass-hover: rgba(31,31,43,0.70);

  --font-heading: 'Inter Tight', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  --transition: 0.25s ease;
  --radius-card: 14px;
  --radius-btn: 100px;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-heading);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Background Scene ───────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: -120px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle at 40% 50%, var(--violet-glow), var(--violet) 60%, transparent 75%);
  filter: blur(110px);
  opacity: 0.28;
  z-index: 0;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  bottom: -100px;
  right: -80px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle at 50% 40%, var(--cyan), #3B82F6 55%, transparent 72%);
  filter: blur(120px);
  opacity: 0.18;
  z-index: 0;
  pointer-events: none;
}

/* ── Screen Management ──────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════════════════════ */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px 48px;
  position: relative;
  overflow: hidden;
}

.login-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.35;
  pointer-events: none;
}

.login-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.5))
          drop-shadow(0 0 48px rgba(139, 92, 246, 0.3));
  animation: logoPulse 3s ease-in-out infinite;
  transition: filter 0.3s ease;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.5)) drop-shadow(0 0 48px rgba(139, 92, 246, 0.3)); }
  50% { filter: drop-shadow(0 0 32px rgba(139, 92, 246, 0.7)) drop-shadow(0 0 64px rgba(139, 92, 246, 0.4)); }
}

.login-header h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #C4B5FD;
  /* 3D text extrusion effect */
  text-shadow:
    0 1px 0 #7C3AED,
    0 2px 0 #6D28D9,
    0 3px 0 #5B21B6,
    0 4px 0 #4C1D95,
    0 5px 0 #3B0764,
    0 6px 0 #2D0A5E,
    0 7px 8px rgba(0,0,0,0.4),
    0 0 20px rgba(139,92,246,0.3),
    0 0 40px rgba(139,92,246,0.15);
  animation: text3dGlow 3s ease-in-out infinite;
}

@keyframes text3dGlow {
  0%, 100% { 
    text-shadow:
      0 1px 0 #7C3AED,
      0 2px 0 #6D28D9,
      0 3px 0 #5B21B6,
      0 4px 0 #4C1D95,
      0 5px 0 #3B0764,
      0 6px 0 #2D0A5E,
      0 7px 8px rgba(0,0,0,0.4),
      0 0 20px rgba(139,92,246,0.3),
      0 0 40px rgba(139,92,246,0.15);
  }
  50% { 
    text-shadow:
      0 1px 0 #7C3AED,
      0 2px 0 #6D28D9,
      0 3px 0 #5B21B6,
      0 4px 0 #4C1D95,
      0 5px 0 #3B0764,
      0 6px 0 #2D0A5E,
      0 7px 0 #1E0040,
      0 8px 12px rgba(0,0,0,0.5),
      0 0 28px rgba(139,92,246,0.45),
      0 0 56px rgba(139,92,246,0.25);
  }
}

.login-header p {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pin-input-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 300px;
}

#pin-input {
  width: 100%;
  padding: 20px;
  font-size: 32px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-align: center;
  letter-spacing: 16px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-card);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

#pin-input::placeholder {
  color: rgba(138, 138, 155, 0.4);
  letter-spacing: 8px;
  font-weight: 400;
}

#pin-input:focus {
  border-color: transparent;
  background-image: linear-gradient(var(--glass-solid), var(--glass-solid)),
                    linear-gradient(135deg, var(--violet), var(--violet-glow), var(--mint));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2),
              0 0 20px rgba(139,92,246,0.3),
              0 0 40px rgba(139,92,246,0.15);
  animation: pinFocusPulse 2s ease-in-out infinite;
}

@keyframes pinFocusPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 0 20px rgba(139,92,246,0.3), 0 0 40px rgba(139,92,246,0.15); }
  50% { box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 0 28px rgba(139,92,246,0.4), 0 0 56px rgba(139,92,246,0.2); }
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--violet-glow));
  color: white;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.2),
    0 4px 20px rgba(139, 92, 246, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.15),
    inset 0 -1px 0 rgba(0,0,0,0.15);
}

.btn-primary:hover:not(:disabled) {
  transform: perspective(800px) rotateX(-3deg) translateY(-2px);
  box-shadow:
    0 8px 28px rgba(0,0,0,0.25),
    0 6px 30px rgba(139, 92, 246, 0.5),
    0 0 50px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.20);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow:
    0 1px 4px rgba(0,0,0,0.3),
    inset 0 2px 6px rgba(0,0,0,0.15);
}

.btn-primary:disabled {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(167, 139, 250, 0.2));
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-secondary:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 6px 20px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.12);
  transform: perspective(800px) rotateX(-2deg) translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--mint), #3DD9A0);
  color: #0A0A12;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.2),
    0 4px 20px rgba(94, 226, 181, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.15),
    inset 0 -1px 0 rgba(0,0,0,0.15);
}

.btn-success:hover {
  transform: perspective(800px) rotateX(-2deg) translateY(-2px);
  box-shadow:
    0 8px 28px rgba(0,0,0,0.25),
    0 6px 30px rgba(94, 226, 181, 0.5),
    0 0 50px rgba(94, 226, 181, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.20);
}

.btn-success:active {
  transform: translateY(0);
  box-shadow:
    0 1px 4px rgba(0,0,0,0.3),
    inset 0 2px 6px rgba(0,0,0,0.15);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red), #E84848);
  color: white;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.2),
    0 4px 20px rgba(242, 109, 109, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.15),
    inset 0 -1px 0 rgba(0,0,0,0.15);
}

.btn-danger:hover {
  transform: perspective(800px) rotateX(-2deg) translateY(-2px);
  box-shadow:
    0 8px 28px rgba(0,0,0,0.25),
    0 6px 30px rgba(242, 109, 109, 0.5),
    0 0 50px rgba(242, 109, 109, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.20);
}

.btn-danger:active {
  transform: translateY(0);
  box-shadow:
    0 1px 4px rgba(0,0,0,0.3),
    inset 0 2px 6px rgba(0,0,0,0.15);
}

.btn-large {
  padding: 20px 40px;
  font-size: 18px;
}

/* ══════════════════════════════════════════════════════════════
   ERROR MESSAGE
   ══════════════════════════════════════════════════════════════ */
.error-message {
  margin-top: 16px;
  padding: 12px 20px;
  background: rgba(242, 109, 109, 0.12);
  border: 1px solid rgba(242, 109, 109, 0.2);
  border-radius: 100px;
  color: var(--red);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-mono);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ══════════════════════════════════════════════════════════════
   APP HEADER
   ══════════════════════════════════════════════════════════════ */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.role-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 100px;
  color: var(--violet-glow);
  text-transform: uppercase;
}

.header-right {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.icon-btn:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.25),
    0 4px 20px rgba(139,92,246,0.15),
    inset 0 1px 0 rgba(255,255,255,0.12);
  transform: perspective(800px) rotateX(-2deg) translateY(-1px);
}

.icon-btn:active {
  box-shadow:
    0 1px 4px rgba(0,0,0,0.3),
    inset 0 2px 6px rgba(0,0,0,0.15);
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════════
   TAB NAVIGATION
   ══════════════════════════════════════════════════════════════ */
.tab-nav {
  display: flex;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 6px 16px;
  gap: 4px;
  position: sticky;
  top: 73px;
  z-index: 99;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 100px;
  text-align: center;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  transform: perspective(800px) rotateX(-2deg) translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, #fff, #f0f0f5);
  color: #0A0A12;
  font-weight: 600;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.2),
    0 4px 20px rgba(139,92,246,0.25),
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -1px 0 rgba(0,0,0,0.08);
}

.tab-content {
  display: none;
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

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

/* ══════════════════════════════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-bar select {
  flex: 1;
  padding: 12px 14px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238A8A9B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-bar select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* ══════════════════════════════════════════════════════════════
   ROOMS GRID
   ══════════════════════════════════════════════════════════════ */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.room-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}

.room-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.15;
  pointer-events: none;
}

.room-card:hover {
  background: var(--glass-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(139, 92, 246, 0.1);
}

.room-card.selected {
  border-color: var(--violet);
  border-left-color: var(--violet);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2), inset 0 0 20px rgba(139, 92, 246, 0.05);
}

.room-card.cleaning {
  border-left-color: var(--amber);
  background: rgba(245, 181, 68, 0.06);
  box-shadow: 0 0 16px rgba(245, 181, 68, 0.1);
}

.room-number {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.room-floor {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.room-status {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.06em;
  display: inline-block;
}

.status-available {
  background: rgba(94, 226, 181, 0.12);
  color: var(--mint);
  border: 1px solid rgba(94, 226, 181, 0.2);
  box-shadow: 0 0 8px rgba(94, 226, 181, 0.1);
}

.status-occupied {
  background: rgba(242, 109, 109, 0.12);
  color: var(--red);
  border: 1px solid rgba(242, 109, 109, 0.2);
  box-shadow: 0 0 8px rgba(242, 109, 109, 0.1);
}

.status-cleaning {
  background: rgba(245, 181, 68, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 181, 68, 0.2);
  box-shadow: 0 0 8px rgba(245, 181, 68, 0.1);
}

/* ══════════════════════════════════════════════════════════════
   TASKS LIST
   ══════════════════════════════════════════════════════════════ */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.10;
  pointer-events: none;
}

.task-card:hover {
  background: var(--glass-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 16px rgba(139, 92, 246, 0.08);
}

.task-info h4 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.task-info p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.task-timer {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--mint);
  text-shadow: 0 0 12px rgba(94, 226, 181, 0.4);
}

/* ══════════════════════════════════════════════════════════════
   SCAN TAB
   ══════════════════════════════════════════════════════════════ */
.scan-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.scan-icon {
  font-size: 80px;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.4));
  animation: scanPulse 2.5s ease-in-out infinite;
}

@keyframes scanPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.4)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.6)); }
}

.scan-container h3 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.scan-container p {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}

.manual-input {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--glass-border);
  width: 100%;
  max-width: 300px;
}

.manual-input p {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 12px;
  font-weight: 500;
  color: var(--muted);
}

.manual-input input {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-family: var(--font-mono);
  text-align: center;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-card);
  color: var(--text);
  margin-bottom: 12px;
  transition: var(--transition);
  outline: none;
}

.manual-input input:focus {
  border-color: transparent;
  background-image: linear-gradient(var(--glass-solid), var(--glass-solid)),
                    linear-gradient(135deg, var(--violet), var(--violet-glow));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
}

.manual-input input::placeholder {
  color: rgba(138, 138, 155, 0.4);
}

/* ══════════════════════════════════════════════════════════════
   TASK MODAL
   ══════════════════════════════════════════════════════════════ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 5, 15, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
  position: relative;
  overflow-x: hidden;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.15;
  pointer-events: none;
  border-radius: 20px;
  z-index: 0;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  z-index: 1;
}

.modal-header h3 {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.modal-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 100px;
  font-size: 20px;
  cursor: pointer;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.25),
    0 2px 8px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.10);
}

.modal-close:hover {
  background: rgba(242, 109, 109, 0.15);
  border-color: rgba(242, 109, 109, 0.3);
  color: var(--red);
  box-shadow:
    0 6px 24px rgba(0,0,0,0.3),
    0 4px 20px rgba(242,109,109,0.3),
    0 0 30px rgba(242,109,109,0.15),
    inset 0 1px 0 rgba(255,255,255,0.15);
  transform: perspective(800px) rotateX(-2deg) translateY(-2px);
}

.modal-close:active {
  box-shadow:
    0 1px 4px rgba(0,0,0,0.3),
    inset 0 2px 6px rgba(0,0,0,0.15);
  transform: translateY(0);
}

.modal-body {
  padding: 20px;
  position: relative;
  z-index: 1;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--glass-border);
  position: relative;
  z-index: 1;
}

.modal-footer button {
  flex: 1;
}

/* ══════════════════════════════════════════════════════════════
   TIMER SECTION
   ══════════════════════════════════════════════════════════════ */
.timer-section {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 52px;
  font-weight: 700;
  color: var(--mint);
  text-shadow: 0 0 20px rgba(94, 226, 181, 0.5);
  margin-bottom: 16px;
  letter-spacing: 4px;
  animation: timerGlow 3s ease-in-out infinite;
}

@keyframes timerGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(94, 226, 181, 0.5); }
  50% { text-shadow: 0 0 30px rgba(94, 226, 181, 0.7), 0 0 60px rgba(94, 226, 181, 0.3); }
}

.timer-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.task-status {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════════════════
   AMENITY SECTION
   ══════════════════════════════════════════════════════════════ */
.amenity-section {
  margin-bottom: 24px;
}

.amenity-section h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.amenity-category {
  margin-bottom: 16px;
}

.amenity-category h5 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.amenity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.amenity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.amenity-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.10;
  pointer-events: none;
}

.amenity-item:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.10);
}

.amenity-item.selected {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.15), inset 0 0 12px rgba(139, 92, 246, 0.05);
}

.amenity-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: transparent;
  background: rgba(31,31,43,0.8);
  border: 2px solid rgba(255,255,255,0.10);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  transition: var(--transition);
  flex-shrink: 0;
}

.amenity-item input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--violet), var(--violet-glow));
  border-color: transparent;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.amenity-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.amenity-item label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  flex: 1;
  color: var(--text);
}

.amenity-item .quantity {
  width: 50px;
  padding: 6px;
  background: rgba(21, 21, 31, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text);
  text-align: center;
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 500;
  transition: var(--transition);
  outline: none;
}

.amenity-item .quantity:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* ══════════════════════════════════════════════════════════════
   NOTES SECTION
   ══════════════════════════════════════════════════════════════ */
.notes-section {
  margin-bottom: 16px;
}

.notes-section h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

#task-notes {
  width: 100%;
  padding: 12px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 400;
  min-height: 80px;
  resize: vertical;
  outline: none;
  transition: var(--transition);
  line-height: 1.5;
}

#task-notes:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

#task-notes::placeholder {
  color: rgba(138, 138, 155, 0.5);
}

/* ══════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--mint), #3DD9A0);
  color: #0A0A12;
  border-radius: 100px;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  z-index: 2000;
  animation: slideUp 0.3s ease;
  box-shadow: 0 8px 32px rgba(94, 226, 181, 0.35), 0 0 20px rgba(94, 226, 181, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast.hidden {
  display: none;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ══════════════════════════════════════════════════════════════
   ICON 3D
   ══════════════════════════════════════════════════════════════ */
.icon-3d {
  width: 20px; height: 20px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: all 0.25s ease;
}
.icon-3d:hover { filter: drop-shadow(0 4px 8px rgba(139,92,246,0.4)); transform: scale(1.1); }

/* ══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════════════════════ */
.hidden {
  display: none !important;
}

/* Deck Plan Styles - Disney Adventure Inspired */
.floor-plan { display: flex; flex-direction: column; gap: 20px; }
.deck-section { 
  background: rgba(31,31,43,0.55); 
  backdrop-filter: blur(20px); 
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06); 
  border-radius: 16px; 
  overflow: hidden; 
}
.deck-header { 
  padding: 10px 20px; 
  font-family: 'Inter Tight', sans-serif; 
  font-size: 14px; 
  font-weight: 600; 
  color: #fff; 
  background: rgba(255,255,255,0.03); 
  border-bottom: 1px solid rgba(255,255,255,0.06); 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}
.deck-header span:last-child { font-size: 11px; color: rgba(255,255,255,0.4); font-weight: 400; }
.deck-body { 
  padding: 16px 20px; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 4px; 
}
.deck-row { 
  display: flex; 
  gap: 4px; 
  flex-wrap: wrap; 
  justify-content: center; 
}
.deck-corridor {
  width: 100%;
  max-width: 560px;
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.06) 0px,
    rgba(255,255,255,0.06) 8px,
    rgba(255,255,255,0.02) 8px,
    rgba(255,255,255,0.02) 16px
  );
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.12);
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.room-block {
  width: 48px;
  height: 34px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.2),
    inset 0 -1px 0 rgba(0,0,0,0.15),
    0 1px 3px rgba(0,0,0,0.3);
  position: relative;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.room-block.available { background: linear-gradient(135deg, #5EE2B5, #34D399); }
.room-block.occupied { background: linear-gradient(135deg, #F26D6D, #EF4444); }
.room-block.cleaning { background: linear-gradient(135deg, #F5B544, #F59E0B); }
.room-block.dirty { background: linear-gradient(180deg, #F5B544, #D97706); }
.room-block.maintenance { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.room-block:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 16px rgba(139,92,246,0.2);
  z-index: 2;
}

/* ══════════════════════════════════════════════════════════════
   LOADING SPINNER
   ══════════════════════════════════════════════════════════════ */
.btn-loader {
  animation: spin 1s linear infinite;
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.85); }
}

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR STYLING
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .rooms-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .amenity-grid {
    grid-template-columns: 1fr;
  }

  .timer-display {
    font-size: 36px;
    letter-spacing: 2px;
  }

  .login-header {
    padding: 32px 24px;
  }

  .login-logo {
    width: 64px;
    height: 64px;
  }

  .modal-content {
    border-radius: 16px;
    max-height: 95vh;
  }

  .btn-primary,
  .btn-secondary,
  .btn-success,
  .btn-danger {
    padding: 14px 24px;
    font-size: 14px;
  }

  .btn-large {
    padding: 16px 28px;
    font-size: 16px;
  }
}

/* ══════════════════════════════════════════════════════════════
   SELECTION & FOCUS GLOBAL
   ══════════════════════════════════════════════════════════════ */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
