/* ==========================================================================
   WORKTIME HR MANAGEMENT - DESIGN SYSTEM & STYLESHEET
   Includes: Mobile-First UX Optimization & Compact Clock Widget
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --bg-modal: #1e293b;
  --bg-input: rgba(15, 23, 42, 0.6);

  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(99, 102, 241, 0.3);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1; /* Indigo */
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  
  --success: #10b981; /* Emerald */
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b; /* Amber */
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444; /* Rose */
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #3b82f6; /* Sky Blue */
  --info-bg: rgba(59, 130, 246, 0.15);
  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.15);

  --font-family: 'Kanit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.35);

  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar Component */
.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-text-accent {
  background: linear-gradient(135deg, #a5b4fc, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-badge {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(99, 102, 241, 0.2));
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.4);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-left: 0.4rem;
}

.version-badge:hover {
  background: rgba(168, 85, 247, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.4);
}

/* Attendance Calendar Component */
.calendar-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.calendar-month-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #a5b4fc;
}

.calendar-nav-btns {
  display: flex;
  gap: 0.35rem;
}

.calendar-weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.calendar-day-cell {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 75px;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-fast);
  cursor: pointer;
}

.calendar-day-cell:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.calendar-day-cell.other-month {
  opacity: 0.3;
  pointer-events: none;
}

.calendar-day-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.calendar-day-cell.is-today .calendar-day-number {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.2);
  padding: 0.1rem 0.35rem;
  border-radius: 9999px;
  display: inline-block;
}

.cal-status-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.2rem;
}

.cal-pill-ontime { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.cal-pill-late { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.cal-pill-leave { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.cal-pill-absent { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.cal-pill-weekend { background: rgba(255, 255, 255, 0.05); color: #64748b; }

/* Version Changelog Timeline */
.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.changelog-item {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid rgba(99, 102, 241, 0.3);
}

.changelog-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
}

.changelog-version {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #a5b4fc;
}

.changelog-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.changelog-list {
  list-style: none;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.changelog-list li {
  position: relative;
  padding-left: 1.1rem;
}

.changelog-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
}

.nav-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.85rem;
}

.role-pill {
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.role-hr {
  background: var(--purple-bg);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.role-employee {
  background: var(--info-bg);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

/* Content Body */
.content-body {
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

/* Dashboard Headers & Tabs */
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.header-title h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.tabs-nav {
  display: flex;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.tab-btn {
  padding: 0.45rem 0.95rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Cards & Glassmorphism Panels */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

/* KPI Summary Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.icon-rose { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.stat-info .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Digital Clock & Check-in Widget (Compact Design) */
.clock-widget-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 868px) {
  .clock-widget-container {
    grid-template-columns: 1fr;
  }
}

.clock-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.25rem 1rem;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), rgba(30, 41, 59, 0.8));
}

.clock-time {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: 'Inter', var(--font-family);
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.clock-date {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.checkin-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Map Display Container */
.map-container {
  height: 240px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

/* Custom Profile Avatar Leaflet Map Marker */
.emp-avatar-marker {
  position: relative;
  width: 46px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-pin-frame {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 2px;
  background: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
  cursor: pointer;
}

.avatar-pin-frame:hover {
  transform: scale(1.2);
  z-index: 99;
}

.avatar-pin-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-pin-inside {
  border: 3px solid #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.75);
}

.avatar-pin-outside {
  border: 3.5px solid #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.75);
}

.avatar-pin-pointer {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #1e293b;
  margin-top: -2px;
}

/* Real Device WebCam Video Frame */
#webcam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  border-radius: var(--radius-lg);
}

/* Map Google-style Place Search Bar */
.map-search-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.map-search-input {
  flex: 1;
  padding: 0.65rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.map-search-input:focus {
  border-color: var(--accent-primary);
}

/* Leaflet Tile Dark Filter */
.leaflet-tile-container img {
  filter: brightness(0.7) invert(1) contrast(1.3) hue-rotate(200deg) saturate(0.35);
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.85rem;
}

.action-buttons-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.btn-large {
  flex: 1;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-checkin {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-checkin:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-checkout {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-checkout:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-ontime { background: var(--success-bg); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.badge-late { background: var(--warning-bg); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.badge-early-leave { background: var(--danger-bg); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }
.badge-leave { background: var(--purple-bg); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.3); }
.badge-pending { background: var(--info-bg); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.3); }
.badge-active { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

/* GPS & Face Scanner Specific Styles */
.gps-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border: 1px solid transparent;
}

.gps-inside {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.gps-outside {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.gps-sim-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  color: var(--text-primary);
}

/* Face Scanner Overlay Modal & Animation */
.scanner-viewport {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 250px;
  margin: 0.85rem auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #090d16;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.face-oval-guide {
  position: absolute;
  width: 160px;
  height: 200px;
  border: 2px dashed #60a5fa;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 10;
}

.face-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, #38bdf8, #818cf8, transparent);
  box-shadow: 0 0 15px #38bdf8;
  animation: laserScan 2.2s infinite ease-in-out;
  z-index: 12;
}

@keyframes laserScan {
  0% { top: 10%; opacity: 0.3; }
  50% { top: 90%; opacity: 1; }
  100% { top: 10%; opacity: 0.3; }
}

.face-mesh-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#818cf8 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.25;
  z-index: 5;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.85rem;
  -webkit-overflow-scrolling: touch;
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.custom-table th {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.85rem 0.85rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  vertical-align: middle;
}

.custom-table tbody tr {
  transition: var(--transition-fast);
}

.custom-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 40px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  min-height: 34px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-lg { max-width: 680px; }
.modal-md { max-width: 520px; }

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  max-width: 420px;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 200;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: #1e293b;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.85rem;
  animation: toastSlideIn 0.3s ease-out forwards;
}

@keyframes toastSlideIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

/* Grid Layouts */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* Mobile-First Responsive Breakpoints */
@media (max-width: 768px) {
  .navbar-container {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.65rem;
    align-items: stretch;
  }

  .nav-brand {
    justify-content: space-between;
  }

  .nav-user-info {
    justify-content: space-between;
    width: 100%;
  }

  .content-body {
    padding: 1rem 0.75rem;
  }

  .dashboard-header {
    margin-bottom: 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .header-title h1 {
    font-size: 1.35rem;
  }

  .tabs-nav {
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    width: 100%;
    padding: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  .clock-widget-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

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

  .clock-time {
    font-size: 1.85rem;
  }

  .map-container {
    height: 200px;
  }

  .scanner-viewport {
    height: 210px;
  }

  .action-buttons-group {
    flex-direction: column;
    gap: 0.6rem;
  }

  .btn-large {
    padding: 0.8rem;
    font-size: 0.95rem;
  }

  .grid-2col {
    grid-template-columns: 1fr;
  }

  .calendar-day-cell {
    min-height: 60px;
    padding: 0.2rem;
  }

  .calendar-day-number {
    font-size: 0.78rem;
  }

  .cal-status-pill {
    font-size: 0.62rem;
    padding: 0.1rem 0.2rem;
  }
}
