/* Modern Dark Theme Design System */
:root {
  --font-primary: 'Outfit', 'Plus Jakarta Sans', -apple-system, sans-serif;

  /* Color Palette */
  --bg-app: #090d16;
  --bg-surface: rgba(30, 41, 59, 0.45);
  --bg-surface-solid: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

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

  /* Accent Colors */
  --color-electricity: #3b82f6;
  --color-pdam: #06b6d4;
  --color-fuel: #f59e0b;
  --color-cng: #f43f5e;
  --color-accent: #8b5cf6;
  --color-success: #10b981;
  --color-danger: #ef4444;

  /* UI Components config */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
  --glass-blur: blur(16px);
}

body.light-theme {
  --bg-app: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.7);
  --bg-surface-solid: #ffffff;
  --border-color: rgba(15, 23, 42, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
}

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

html,
body {
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto;
}

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

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

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-sm);
}

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

/* Helpers */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

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

/* Premium Glassmorphic Panels */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Buttons */
.btn {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-1px);
}

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

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

.btn-accent {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  background: linear-gradient(135deg, #10b981, #047857);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
  padding: 12px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Forms styling */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 15px;
  transition: all 0.2s ease;
}

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

.input-helper {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-help-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
}

/* Form layouts */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.form-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-electricity);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

/* 1. AUTH SCREEN */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at 10% 20%, rgba(29, 78, 216, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 45%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  animation: fadeIn 0.4s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 13px;
}

.auth-links a {
  color: var(--color-electricity);
  text-decoration: none;
  transition: opacity 0.2s;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Pull-to-Refresh Indicator (Mobile & iOS/Android PWA) */
.ptr-indicator {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-surface-solid);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-8px);
  transition: height 0.2s ease, opacity 0.2s ease, transform 0.2s ease, margin-bottom 0.2s ease;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.ptr-indicator.pulling {
  opacity: 1;
  transform: translateY(0);
}

.ptr-icon {
  font-size: 16px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.ptr-indicator.refreshing .ptr-icon {
  animation: ptrRotate 0.8s linear infinite;
}

@keyframes ptrRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* 2. APP VIEW */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* App Header */
.app-header {
  position: sticky;
  top: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  margin: 16px;
  border-radius: var(--radius-md);
}

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

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.app-body {
  display: flex;
  flex: 1;
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow: visible;
}

.app-sidebar {
  width: 250px;
  flex-shrink: 0;
  margin: 0 0 16px 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 100;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.app-sidebar::-webkit-scrollbar {
  width: 5px;
}

.app-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.app-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.sidebar-hidden .app-sidebar {
  margin-left: -286px;
  opacity: 0;
  pointer-events: none;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 24px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-icon {
  color: currentColor;
  flex-shrink: 0;
  width: 22px !important;
  height: 22px !important;
}

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

.nav-tab.active {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-details {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--color-electricity);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* App Content Area */
.app-content {
  flex: 1;
  min-width: 0;
  padding: 0 16px 16px 16px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  overflow: visible;
}

/* Hide mobile list by default on desktop */
.mobile-logs-list {
  display: none;
}

/* Global Date Range Filter Bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.filter-title {
  font-weight: 600;
  font-size: 11px;
}

.filter-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-inline label {
  margin-bottom: 0;
  font-size: 10px;
}

.input-inline input {
  padding: 2px 4px;
  width: 105px;
  font-size: 10px;
  cursor: pointer;
  text-align: center;
}

.input-inline-wrapper {
  position: relative;
  display: inline-block;
}

.input-inline-wrapper input[type="date"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
}

.input-inline-wrapper input[type="text"] {
  position: relative;
  z-index: 1;
}

.filter-bar .btn {
  padding: 4px 8px;
  font-size: 10px;
}

/* Pages routing style */
.app-page {
  display: none;
  animation: fadeIn 0.3s ease-out;
  width: 100%;
  min-width: 0;
}

.app-page.active {
  display: block;
}

/* Table Containment & Responsive Scroll Rules */
.table-container {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.responsive-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

/* 3. DASHBOARD PAGE STYLE */
/* Revenue Summary Cards */
.revenue-summary-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.revenue-summary-card {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.revenue-summary-card.highlight {
  border-left: 3px solid var(--color-accent);
}

.revenue-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.rev-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-lbl {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.stat-val {
  font-size: 24px;
  font-weight: 700;
}

.rev-stat.highlight .stat-val {
  color: var(--color-accent);
}

/* Metrics Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.metric-card {
  display: flex;
  padding: 16px;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-2px);
}

.border-electricity {
  border-left: 4px solid var(--color-electricity);
}

.border-pdam {
  border-left: 4px solid var(--color-pdam);
}

.border-fuel {
  border-left: 4px solid var(--color-fuel);
}

.border-cng {
  border-left: 4px solid var(--color-cng);
}

.card-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.font-electricity {
  color: var(--color-electricity);
}

.font-pdam {
  color: var(--color-pdam);
}

.font-fuel {
  color: var(--color-fuel);
}

.font-cng {
  color: var(--color-cng);
}

.card-info {
  flex: 1;
}

.card-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* Cost-to-revenue Progress Bar */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease-in-out;
}

.bg-electricity {
  background: var(--color-electricity);
}

.bg-pdam {
  background: var(--color-pdam);
}

.bg-fuel {
  background: var(--color-fuel);
}

.bg-cng {
  background: var(--color-cng);
}

/* 4. TABLES & LOGS PAGES */
.page-action-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.project-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.btn-add-project {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.project-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.project-filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.project-filter-group #project-filter-status {
  width: 180px;
  padding: 8px 12px;
}

.project-filter-group #project-search-input {
  width: 220px;
  padding: 8px 12px;
}

.table-container {
  padding: 20px;
}

.table-header-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.responsive-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

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

.badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-morning,
.badge-MORNING {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-electricity);
}

.badge-evening,
.badge-EVENING,
.badge-afternoon,
.badge-AFTERNOON {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-fuel);
}

.badge-night,
.badge-NIGHT {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-accent);
}

.badge-scheduled {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-electricity);
}

.badge-completed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.badge-overdue {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.badge-cancelled {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
}


/* Mobile logs cards (used instead of table on small screens) */
.mobile-logs-list {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.mobile-log-card {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.15);
}

.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.mobile-card-title {
  font-weight: 600;
  font-size: 14px;
}

.mobile-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: 12px;
}

.mobile-card-row-full {
  grid-column: span 2;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  padding-top: 6px;
  margin-top: 4px;
}

.m-label {
  color: var(--text-secondary);
}

.m-val {
  font-weight: 500;
}

.m-cost {
  color: var(--color-electricity);
  font-weight: 600;
}

/* 5. MODAL POPUPS STYLE */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlide 0.3s ease-out;
  overflow: hidden;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

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

.modal-card.modal-compact {
  max-width: 540px;
}

.modal-compact .modal-body {
  padding: 12px 20px;
}

.modal-compact .modal-header {
  padding: 14px 20px;
}

.modal-compact .modal-footer {
  padding: 12px 20px;
}

.modal-compact .form-group {
  margin-bottom: 10px;
}

.modal-compact label {
  font-size: 12px;
  margin-bottom: 4px;
}

.modal-compact input[type="text"],
.modal-compact input[type="number"],
.modal-compact input[type="date"],
.modal-compact input[type="time"],
.modal-compact input[type="datetime-local"],
.modal-compact select,
.modal-compact textarea {
  padding: 12px 14px;
  font-size: 14px;
}

.modal-compact .form-section-title {
  margin: 12px 0 6px 0;
  font-size: 11px;
  padding-bottom: 2px;
}

.modal-compact .input-helper {
  font-size: 10px;
  margin-top: 2px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

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

.modal-body {
  padding: 20px 24px;
  flex: 1;
  min-height: 0;
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Admin limits helper */
.admin-only.hidden,
#add-project-btn.hidden {
  display: none !important;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}

.toast {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success {
  background: #059669;
  border-left: 4px solid #10b981;
}

.toast-error {
  background: #b91c1c;
  border-left: 4px solid #ef4444;
}

.toast-info {
  background: #1e3a8a;
  border-left: 4px solid #3b82f6;
}

/* ANIMATIONS */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

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

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

  to {
    transform: rotate(360deg);
  }
}

/* 6. RESPONSIVE DESIGN - MEDIA QUERIES */

/* For Tablet / Small Desktop (max 1024px) */
@media (max-width: 1024px) {
  .app-header {
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
  }

  .app-sidebar {
    position: fixed;
    height: calc(100vh - 85px);
    max-height: calc(100vh - 85px);
    top: 74px;
    left: 0;
    margin-left: 0;
    transform: translateX(-110%);
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 30px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  body:not(.sidebar-hidden) .app-sidebar {
    transform: translateX(0);
    margin-left: 16px;
    opacity: 1;
    pointer-events: auto;
    box-shadow: var(--shadow-lg);
  }
}

/* For Mobile Devices (max 768px) */
@media (max-width: 768px) {

  .form-row-2,
  .form-row-3,
  .form-row-4 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Prevent full collapsing of columns in compact modals on mobile */
  .modal-compact .form-row-2 {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .modal-compact .form-row-3 {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 8px !important;
  }

  .modal-compact .form-row-4 {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }

  /* Additional vertical shrinkage on mobile */
  .modal-compact .modal-body {
    padding: 10px 16px !important;
  }

  .modal-compact .form-group {
    margin-bottom: 8px !important;
  }

  .modal-compact label {
    font-size: 11px !important;
    margin-bottom: 2px !important;
  }

  .modal-compact input[type="text"],
  .modal-compact input[type="number"],
  .modal-compact input[type="date"],
  .modal-compact input[type="time"],
  .modal-compact input[type="datetime-local"],
  .modal-compact select,
  .modal-compact textarea {
    padding: 12px 12px !important;
    font-size: 14px !important;
  }

  .modal-compact .form-section-title {
    margin: 8px 0 4px 0 !important;
    font-size: 10px !important;
    padding-bottom: 1px !important;
  }

  .modal-compact .modal-header {
    padding: 10px 16px !important;
  }

  .modal-compact .modal-header h2 {
    font-size: 15px !important;
  }

  .modal-compact .modal-footer {
    padding: 10px 16px !important;
  }

  .filter-bar {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .filter-inputs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

  .input-inline {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .input-inline input {
    width: 105px;
  }



  /* Swap table for card views on mobile, but keep admin table visible */
  .responsive-table-wrapper {
    display: none;
  }

  #page-admin .responsive-table-wrapper {
    display: block;
  }

  /* Maintenance schedule card view: 2 cards per row on mobile */
  #page-maintenance .responsive-table-wrapper {
    display: none !important;
  }

  #page-maintenance #maintenance-mobile-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-top: 12px !important;
  }

  /* Mobile layout rules for Project Planning Page */
  .project-header-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .project-action-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .project-filter-group {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .project-dropdowns-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    width: 100% !important;
    align-items: center !important;
  }

  .project-dropdowns-row select {
    flex: 1 !important;
    width: 50% !important;
    min-width: 0 !important;
    font-size: 11px !important;
    padding: 6px 4px !important;
    height: 36px !important;
    box-sizing: border-box !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .project-filter-group #project-search-input {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #add-project-btn:not(.hidden) {
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  #add-project-btn.hidden {
    display: none !important;
  }

  .scroll-y {
    overflow-y: auto !important;
  }

  .mobile-logs-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding-bottom: 32px !important;
  }

  /* Logbook Mobile Header & Action Bar Rules */
  .logbook-header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .logbook-header-row .search-engine-wrapper {
    width: 100% !important;
  }

  .logbook-actions-inline {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }

  .logbook-actions-inline #logbook-status-filter,
  .logbook-actions-inline #add-logbook-btn {
    flex: 1 !important;
    justify-content: center !important;
  }

  .modal-overlay {
    padding: 8px !important;
  }

  .modal-card {
    max-height: 90vh !important;
    width: 100% !important;
  }

  .app-header {
    margin: 8px;
    padding: 12px;
    top: 8px;
  }

  .app-content {
    padding: 0 8px 32px 8px !important;
  }
}

/* Inventory Page Styles */
.inventory-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.inventory-card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.inventory-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.15);
}

.inventory-card-photo-wrapper {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.inventory-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inventory-card-no-photo {
  font-size: 32px;
  opacity: 0.3;
}

.inventory-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inventory-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.inventory-card-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.inventory-card-stock {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.inventory-card-stock-val {
  font-size: 15px;
  font-weight: 700;
}

.inventory-card-stock-val.stock-low {
  color: var(--color-danger);
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.inventory-card-stock-val.stock-good {
  color: var(--color-success);
}

.inventory-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.inventory-card-actions .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-inv-add {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-inv-add:hover {
  background: var(--color-success);
  color: #fff;
}

.btn-inv-take {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.inventory-card-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-danger);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  z-index: 10;
}

.inventory-card-delete-btn:hover {
  background: var(--color-danger);
  color: #fff;
  transform: scale(1.1);
}

/* Global Loading Overlay */
.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.global-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.gear-spinner {
  width: 64px;
  height: 64px;
  animation: spin 3s linear infinite;
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.4));
}

.loader-text {
  color: var(--text-primary, #f8fafc);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  animation: pulse 1.5s ease-in-out infinite;
}

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

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

@keyframes pulse {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

/* Mobile Overrides for Inventory (2 items per row) */
@media (max-width: 768px) {
  .inventory-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .inventory-card {
    padding: 10px !important;
    gap: 8px !important;
  }

  .inventory-card-photo-wrapper {
    height: 100px !important;
  }

  .inventory-card-title {
    font-size: 13px !important;
  }

  .inventory-card-stock {
    font-size: 11px !important;
  }

  .inventory-card-stock-val {
    font-size: 12px !important;
  }

  .inventory-card-delete-btn {
    top: 4px !important;
    right: 4px !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #inventory-logs-table-wrapper {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  #inventory-logs-table-wrapper table th,
  #inventory-logs-table-wrapper table td {
    white-space: nowrap !important;
  }

  #inventory-logs-mobile-list {
    display: none !important;
  }
}

/* Shift Checklist Deadline Notification Styles */
.shift-alert-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
}

.shift-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-left: 5px solid #ef4444;
  border-radius: var(--radius-sm, 8px);
  padding: 12px 16px;
  color: #fca5a5;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
  animation: shiftAlertPulse 2s infinite ease-in-out;
  transition: all 0.3s ease;
}

.shift-alert-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
}

.shift-alert-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.shift-alert-action-btn {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.shift-alert-action-btn:hover {
  background: #dc2626;
}

@keyframes shiftAlertPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@media (max-width: 768px) {
  .shift-alert-banner {
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .shift-alert-action-btn {
    align-self: flex-end;
    width: 100%;
    text-align: center;
  }
}

/* -------------------------------------------------------------
 * ADMIN PAGE HUB & CARD MENU STYLES
 * ------------------------------------------------------------- */
.admin-hub-header {
  margin-bottom: 24px;
}

.admin-hub-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.admin-menu-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  cursor: pointer;
  transition: all 0.25 ease;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.admin-menu-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.35);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-card-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm, 12px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-blue-subtle {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.bg-amber-subtle {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.bg-purple-subtle {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.admin-card-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.admin-card-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.admin-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-electricity, #3b82f6);
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  transition: color 0.2s ease;
}

.admin-menu-card:hover .admin-card-footer {
  color: #60a5fa;
}

.admin-sub-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-sub-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.btn-back {
  padding: 8px 16px;
  font-size: 13px;
}

/* Page Settings Toggle List */
.page-setting-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: var(--radius-sm, 8px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

.page-setting-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.page-setting-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-setting-icon {
  font-size: 22px;
}

/* iOS-style Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #475569;
  transition: .3s ease;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s ease;
  border-radius: 50%;
}

input:checked+.toggle-slider {
  background-color: var(--color-success, #10b981);
}

input:focus+.toggle-slider {
  box-shadow: 0 0 1px var(--color-success, #10b981);
}

input:checked+.toggle-slider:before {
  transform: translateX(22px);
}

/* -------------------------------------------------------------
 * PROJECT PLANNING STYLES
 * ------------------------------------------------------------- */
.badge-planning {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-in-progress {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-on-hold {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.badge-done {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.project-photos-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-thumb-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.photo-thumb-box:hover {
  transform: scale(1.05);
}

.photo-thumb-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.photo-thumb-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 2px;
  color: var(--text-muted);
}

/* Room Checklist Mini Cards Grid */
.room-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

.room-mini-card {
  background: var(--bg-surface, rgba(30, 41, 59, 0.7));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 8px);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  position: relative;
}

.room-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 6px 18px rgba(0, 0, 0, 0.3));
  border-color: var(--color-primary, #3b82f6);
}

.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.room-number-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  display: flex;
  align-items: center;
  gap: 4px;
}

.room-items-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 11px;
}

.room-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
}

.room-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile 2 Cards Per Row Media Query */
@media (max-width: 768px) {
  .room-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .room-mini-card {
    padding: 8px 10px !important;
  }

  .room-number-title {
    font-size: 13px !important;
  }

  .room-card-header .badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }

  .room-items-summary {
    font-size: 10px !important;
    gap: 3px !important;
  }

  .room-card-footer {
    font-size: 9px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }
}

/* Visitor Role (Read Only) Guard */
body.role-visitor .btn-primary,
body.role-visitor .btn-add-report,
body.role-visitor .btn-add-checklist,
body.role-visitor #add-logbook-btn,
body.role-visitor #add-project-btn,
body.role-visitor #add-user-btn,
body.role-visitor #open-room-config-btn,
body.role-visitor #input-revenue-btn,
body.role-visitor #export-pdf-btn,
body.role-visitor .btn-danger,
body.role-visitor .btn-edit,
body.role-visitor .admin-only,
body.role-visitor .visitor-hidden {
  display: none !important;
}

body.role-visitor .room-mini-card {
  cursor: default;
}

body.role-visitor .inventory-card {
  cursor: default;
}

/* Project Planning Summary Layout: Row 1 (3 Count Cards) & Row 2 (Total Estimated Cost) */
.project-summary-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
}

.project-counts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.project-metric-card {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-md);
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-metric-card .card-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.project-metric-card .card-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.project-metric-card .card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.project-metric-card .card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2px 0 0 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Row 2: Total Estimated Cost Card (Full Width 1 Row) */
.project-cost-card {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-md);
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-cost-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-cost-card .card-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}

.project-cost-card .card-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
}

.project-cost-card .card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.project-cost-card .card-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
  margin: 0;
  white-space: nowrap;
}

/* Responsive Scaling for Mobile & Tablet */
@media (max-width: 768px) {
  .project-counts-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  .project-metric-card {
    padding: 6px 8px !important;
    gap: 6px !important;
    border-radius: var(--radius-sm) !important;
  }

  .project-metric-card .card-icon {
    font-size: 14px !important;
  }

  .project-metric-card .card-label {
    font-size: 9.5px !important;
  }

  .project-metric-card .card-value {
    font-size: 22px !important;
  }

  .project-cost-card {
    padding: 8px 12px !important;
    gap: 8px !important;
    border-radius: var(--radius-sm) !important;
  }

  .project-cost-card .card-icon {
    font-size: 18px !important;
  }

  .project-cost-card .card-label {
    font-size: 11.5px !important;
  }

  .project-cost-card .card-value {
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .project-counts-grid {
    gap: 4px !important;
  }

  .project-metric-card {
    padding: 5px 6px !important;
    gap: 4px !important;
  }

  .project-metric-card .card-icon {
    font-size: 12px !important;
  }

  .project-metric-card .card-label {
    font-size: 8.5px !important;
    letter-spacing: -0.2px;
  }

  .project-metric-card .card-value {
    font-size: 18px !important;
  }

  .project-cost-card {
    padding: 7px 10px !important;
  }

  .project-cost-card .card-icon {
    font-size: 15px !important;
  }

  .project-cost-card .card-label {
    font-size: 10px !important;
  }

  .project-cost-card .card-value {
    font-size: 12.5px !important;
  }
}

/* Admin Page Compact Menu Grid (2 Cards per Row) */
.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 16px;
  width: 100%;
}

.admin-menu-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.admin-menu-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 130, 246, 0.4);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-card-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-card-icon-wrapper svg {
  width: 20px;
  height: 20px;
}

.bg-blue-subtle {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-electricity);
}

.bg-amber-subtle {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-fuel);
}

.bg-purple-subtle {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-accent);
}

.bg-green-subtle {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.admin-card-content h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.admin-card-content p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-electricity);
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-card-footer svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.admin-menu-card:hover .admin-card-footer svg {
  transform: translateX(4px);
}

/* Mobile & Tablet Responsiveness (Strictly 2 Cards per Row) */
@media (max-width: 768px) {
  .admin-card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .admin-menu-card {
    padding: 10px 12px !important;
    gap: 8px !important;
    border-radius: var(--radius-sm) !important;
  }

  .admin-card-icon-wrapper {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
  }

  .admin-card-icon-wrapper svg {
    width: 17px !important;
    height: 17px !important;
  }

  .admin-card-content h3 {
    font-size: 13px !important;
  }

  .admin-card-content p {
    font-size: 10.5px !important;
    line-height: 1.3 !important;
    -webkit-line-clamp: 2;
  }

  .admin-card-footer {
    font-size: 10px !important;
    padding-top: 6px !important;
  }
}

@media (max-width: 480px) {
  .admin-card-grid {
    gap: 6px !important;
  }

  .admin-menu-card {
    padding: 8px 10px !important;
  }

  .admin-card-content h3 {
    font-size: 12px !important;
  }

  .admin-card-content p {
    font-size: 9.5px !important;
    -webkit-line-clamp: 2;
  }

  .admin-card-footer span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Logbook Searchable Item Dropdown Option Styling */
.logbook-item-option:hover {
  background: rgba(59, 130, 246, 0.15) !important;
  color: var(--color-primary, #3b82f6) !important;
}

/* ------------------------------------------------------------- */
/* PROJECT PLANNING CARD REDESIGN (Match User Mockup Design) */
/* ------------------------------------------------------------- */
.project-card-box {
  background: #374151; /* Dark charcoal/slate gray background as shown in mockup */
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 16px;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.project-card-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border-color: rgba(59, 130, 246, 0.5);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  gap: 16px;
}

.project-card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.3;
  word-break: break-word;
}

.project-card-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 120px;
}

.project-card-status-col .badge {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 500;
}

.project-card-progress-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
  max-width: 120px;
  margin-top: 4px;
}

.project-card-progress-bar {
  width: 100%;
  height: 12px;
  background: #93c5fd; /* Soft light blue track as shown in mockup */
  border-radius: 999px;
  overflow: hidden;
}

.project-card-progress-fill {
  height: 100%;
  background: #3b82f6; /* Bright blue progress fill */
  border-radius: 999px;
  transition: width 0.4s ease;
}

.project-card-progress-text {
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 400;
  margin-top: 4px;
  text-align: right;
}

.project-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  font-size: 11.5px;
}

.project-card-dates-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.project-card-date-item {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 11.5px;
}

.project-card-date-item .date-lbl {
  color: #94a3b8;
  font-weight: 400;
  font-size: 11.5px;
}

.project-card-date-item .date-val {
  color: #e2e8f0;
  font-weight: 500;
  font-size: 11.5px;
}

.project-card-pic-col {
  display: flex;
  gap: 4px;
  align-items: center;
  text-align: right;
  font-size: 11.5px;
}

.project-card-pic-col .pic-lbl {
  color: #94a3b8;
  font-weight: 400;
  font-size: 11.5px;
}

.project-card-pic-col .pic-val {
  color: #e2e8f0;
  font-weight: 500;
  font-size: 11.5px;
}

/* Under Maintenance Overlay */
.maintenance-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 80%);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(16px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.maintenance-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Maintenance Schedule Compact Mobile Cards (Hidden on desktop, 2 cards per row on mobile) & Popup Styles */
#maintenance-mobile-list {
  display: none;
}

.maint-card-compact {
  background: var(--bg-surface-solid, rgba(30, 41, 59, 0.8));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.maint-card-compact:hover,
.maint-card-compact:active {
  transform: translateY(-2px);
  border-color: var(--border-focus, #3b82f6);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.maint-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.maint-card-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
}

.maint-card-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.maint-card-task {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.maint-card-asset {
  font-size: 10px;
  color: #93c5fd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.maint-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 10px;
  color: var(--text-muted, #64748b);
}

.btn-status-option.active {
  outline: 2px solid #3b82f6 !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4) !important;
  transform: scale(1.02);
}