@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --primary: #0D47A1;
  --primary-light: #1565C0;
  --secondary: #1976D2;
  --accent: #42A5F5;
  --accent-dark: #E3F2FD;
  --bg: #F0F4F8;
  --bg-card: #FFFFFF;
  --text: #1A2332;
  --text-secondary: #5A6A7E;
  --text-muted: #8D99AE;
  --border: #DAE2EC;
  --border-light: #EDF1F5;
  --urgency-low: #22C55E;
  --urgency-low-bg: #DCFCE7;
  --urgency-medium: #F59E0B;
  --urgency-medium-bg: #FEF3C7;
  --urgency-high: #EF4444;
  --urgency-high-bg: #FEE2E2;
  --urgency-emergency: #DC2626;
  --urgency-emergency-bg: #FEE2E2;
  --status-open: #3B82F6;
  --status-open-bg: #DBEAFE;
  --status-progress: #F59E0B;
  --status-progress-bg: #FEF3C7;
  --status-resolved: #22C55E;
  --status-resolved-bg: #DCFCE7;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

::selection {
  background: var(--secondary);
  color: var(--bg-card);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* =================== ROLE SELECT =================== */
.role-select-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent-dark) 100%);
}

.role-select-container {
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.role-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: bounceIn 0.6s ease;
}

.role-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--bg-card);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.role-subtitle {
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 40px;
  font-weight: 300;
}

.role-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.role-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  color: var(--bg-card);
  font-family: inherit;
  font-size: inherit;
}

.role-card:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.role-card-icon {
  font-size: 2.4rem;
}

.role-card-label {
  font-size: 1.1rem;
  font-weight: 600;
}

.role-card-desc {
  font-size: 0.82rem;
  opacity: 0.75;
  font-weight: 300;
}

/* =================== APP SHELL =================== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: var(--primary);
  color: var(--bg-card);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(27, 73, 101, 0.2);
}

.manager-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.back-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--bg-card);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-family: inherit;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.header-title {
  font-size: 1.15rem;
  font-weight: 600;
  flex: 1;
}

.header-role {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
}

/* =================== TABS =================== */
.tab-bar {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 68px;
  z-index: 99;
}

.tab-btn {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(27, 73, 101, 0.04);
}

.tab-btn:hover:not(.active) {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.02);
}

.tab-icon {
  font-size: 1rem;
}

/* =================== MAIN CONTENT =================== */
.app-main {
  flex: 1;
  padding: 20px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* =================== FORM =================== */
.submit-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.form-input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(98, 182, 203, 0.15);
}

.form-textarea {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(98, 182, 203, 0.15);
}

/* =================== CATEGORY CHIPS =================== */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.category-chip:hover {
  border-color: var(--secondary);
  background: rgba(98, 182, 203, 0.06);
}

.category-chip.selected {
  border-color: var(--primary);
  background: rgba(27, 73, 101, 0.08);
  color: var(--primary);
  font-weight: 600;
}

.chip-icon {
  font-size: 1.1rem;
}

/* =================== URGENCY CHIPS =================== */
.urgency-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.urgency-chip {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
}

.urgency-chip.urgency-low { border-color: var(--border); }
.urgency-chip.urgency-medium { border-color: var(--border); }
.urgency-chip.urgency-high { border-color: var(--border); }
.urgency-chip.urgency-emergency { border-color: var(--border); }

.urgency-chip.urgency-low.selected { border-color: var(--urgency-low); background: var(--urgency-low-bg); }
.urgency-chip.urgency-medium.selected { border-color: var(--urgency-medium); background: var(--urgency-medium-bg); }
.urgency-chip.urgency-high.selected { border-color: var(--urgency-high); background: var(--urgency-high-bg); }
.urgency-chip.urgency-emergency.selected { border-color: var(--urgency-emergency); background: var(--urgency-emergency-bg); }

.urgency-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.urgency-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* =================== PHOTO UPLOAD =================== */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}

.photo-upload-area:hover {
  border-color: var(--secondary);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px;
  cursor: pointer;
  color: var(--text-muted);
}

.upload-icon {
  font-size: 2rem;
}

.upload-text {
  font-size: 0.88rem;
}

.photo-preview-container {
  position: relative;
}

.photo-preview {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

.remove-photo {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

/* =================== SUBMIT BUTTON =================== */
.submit-btn {
  padding: 16px;
  background: var(--primary);
  color: var(--bg-card);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.submit-btn:hover:not(:disabled) {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =================== SUCCESS SCREEN =================== */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  animation: fadeInUp 0.4s ease;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.success-screen h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--urgency-low);
}

.success-screen p {
  color: var(--text-secondary);
}

/* =================== REQUEST CARDS =================== */
.requests-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.request-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.4s ease both;
}

.request-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.request-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.request-category-icon {
  font-size: 1.6rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.request-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.request-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.request-card-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.request-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.request-card-photo {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.request-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.request-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* =================== BADGES =================== */
.status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-badge.large {
  font-size: 0.82rem;
  padding: 6px 14px;
}

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

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

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

.urgency-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.urgency-tag.large {
  font-size: 0.78rem;
  padding: 5px 12px;
}

.urgency-tag-low {
  background: var(--urgency-low-bg);
  color: var(--urgency-low);
}

.urgency-tag-medium {
  background: var(--urgency-medium-bg);
  color: var(--urgency-medium);
}

.urgency-tag-high {
  background: var(--urgency-high-bg);
  color: var(--urgency-high);
}

.urgency-tag-emergency {
  background: var(--urgency-emergency-bg);
  color: var(--urgency-emergency);
  animation: pulse 1.5s ease infinite;
}

/* =================== MANAGER ACTIONS =================== */
.manager-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.action-btn {
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn {
  background: var(--bg);
  color: var(--text-secondary);
}

.view-btn:hover {
  background: var(--border);
}

.progress-btn {
  background: var(--status-progress-bg);
  color: var(--status-progress);
}

.progress-btn:hover {
  background: var(--urgency-medium);
  color: white;
}

.resolve-btn {
  background: var(--status-resolved-bg);
  color: var(--status-resolved);
}

.resolve-btn:hover {
  background: var(--urgency-low);
  color: white;
}

.reopen-btn {
  background: var(--status-open-bg);
  color: var(--status-open);
}

.reopen-btn:hover {
  background: var(--status-open);
  color: white;
}

/* =================== STATS BAR =================== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.4s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }
.stat-card:nth-child(5) { animation-delay: 0.2s; }

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-total .stat-number { color: var(--primary); }
.stat-total { border-top: 3px solid var(--primary); }
.stat-open .stat-number { color: var(--status-open); }
.stat-open { border-top: 3px solid var(--status-open); }
.stat-progress .stat-number { color: var(--status-progress); }
.stat-progress { border-top: 3px solid var(--status-progress); }
.stat-resolved .stat-number { color: var(--status-resolved); }
.stat-resolved { border-top: 3px solid var(--status-resolved); }
.stat-emergency .stat-number { color: var(--urgency-emergency); }
.stat-emergency { border-top: 3px solid var(--urgency-emergency); }

/* =================== ALERT BANNER =================== */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 24px;
  animation: fadeInUp 0.5s ease both;
}

.emergency-alert {
  background: var(--urgency-emergency-bg);
  color: var(--urgency-emergency);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-icon {
  font-size: 1.2rem;
}

/* =================== FILTERS =================== */
.filters-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-select {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-select:focus {
  border-color: var(--secondary);
}

/* =================== SECTION HEADER =================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-dark);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

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

/* =================== MODAL =================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
}

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

/* =================== DETAIL VIEW =================== */
.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-icon {
  font-size: 2.4rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-md);
}

.detail-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.detail-unit {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.detail-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section h3 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.detail-section p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.detail-description {
  background: var(--bg);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--secondary);
}

.detail-photo {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.save-note-btn {
  margin-top: 10px;
  padding: 10px 20px;
  background: var(--primary);
  color: var(--bg-card);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.save-note-btn:hover:not(:disabled) {
  background: var(--primary-light);
}

.save-note-btn:disabled {
  opacity: 0.5;
}

.status-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.manager-note-display {
  background: var(--urgency-low-bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--urgency-low);
  font-style: italic;
}

/* =================== EMPTY & LOADING =================== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state.small {
  padding: 32px 24px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.skeleton-card {
  height: 120px;
  background: linear-gradient(110deg, var(--border-light) 30%, var(--bg) 50%, var(--border-light) 70%);
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: shimmer 1.5s infinite;
}

.skeleton-stats {
  height: 80px;
  background: linear-gradient(110deg, var(--border-light) 30%, var(--bg) 50%, var(--border-light) 70%);
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: shimmer 1.5s infinite;
}

/* =================== DASHBOARD VIEW =================== */
.dashboard-view {
  display: flex;
  flex-direction: column;
}

.requests-view {
  display: flex;
  flex-direction: column;
}

/* =================== ANIMATIONS =================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

/* =================== RESPONSIVE =================== */
@media (max-width: 640px) {
  .role-cards {
    flex-direction: column;
  }

  .role-card {
    padding: 24px 16px;
  }

  .role-title {
    font-size: 1.8rem;
  }

  .app-main {
    padding: 16px;
  }

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

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .manager-actions {
    flex-wrap: wrap;
  }

  .filters-bar {
    flex-direction: column;
  }

  .modal-content {
    padding: 20px;
    max-height: 90vh;
  }

  .detail-icon {
    font-size: 2rem;
    width: 44px;
    height: 44px;
  }

  .detail-title {
    font-size: 1.1rem;
  }

  .status-actions {
    flex-direction: column;
  }

  .status-actions .action-btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .category-grid {
    gap: 6px;
  }

  .category-chip {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .stat-number {
    font-size: 1.4rem;
  }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to Maintenance Hub! Choose your role — Tenant or Manager.", "view": "role-select", "highlight_selector": ".role-cards", "wait_for": "user_interaction"},
  {"step": 2, "narration": "As a Tenant, fill out the maintenance request form with your unit number, category, urgency level, and a description of the issue.", "view": "tenant", "highlight_selector": ".submit-form", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "You can optionally attach a photo of the issue to help the manager understand the problem.", "view": "tenant", "highlight_selector": ".photo-upload-area", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "After submitting, switch to 'My Requests' to track the status of all your maintenance requests.", "view": "tenant", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 5, "narration": "As the Manager, the Overview dashboard shows key statistics and highlights the most urgent open requests.", "view": "manager", "highlight_selector": ".stats-bar", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Emergency requests are flagged with a red alert banner at the top of the dashboard for immediate attention.", "view": "manager", "highlight_selector": ".emergency-alert", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "Switch to 'All Requests' to filter by status and category, and manage each request — start work, resolve, or reopen.", "view": "manager", "highlight_selector": ".filters-bar", "wait_for": "tap_to_continue"},
  {"step": 8, "narration": "Click any request card to see full details, add manager notes, and update the status.", "view": "manager", "highlight_selector": ".modal-content", "wait_for": "tap_to_continue"}
]
-->

.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem;
}

.auth-error {
  margin: 0 0 16px;
  color: var(--urgency-high);
  font-size: 0.92rem;
}

.upload-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.capture-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.capture-btn:hover:not(:disabled) {
  border-color: var(--secondary);
  background: rgba(98, 182, 203, 0.06);
}

.capture-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.capture-icon {
  font-size: 1.05rem;
}

.photo-preview-container .remove-photo {
  z-index: 1;
}

.notification-settings {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-settings-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notification-settings-icon {
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg);
  flex-shrink: 0;
}

.notification-settings-header h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.notification-settings-header p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.notification-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}

.notification-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.notification-status-idle {
  background: var(--bg);
  color: var(--text-secondary);
}

.notification-status-pending {
  background: var(--urgency-medium-bg);
  color: var(--urgency-medium);
}

.notification-status-pending .notification-status-dot {
  background: var(--urgency-medium);
  animation: pulse 1.2s ease infinite;
}

.notification-status-sent {
  background: var(--status-resolved-bg);
  color: var(--status-resolved);
}

.notification-status-sent .notification-status-dot {
  background: var(--status-resolved);
}

.notification-feedback {
  border-left: 3px solid var(--secondary);
  background: rgba(98, 182, 203, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.notification-feedback strong {
  display: block;
  font-size: 0.84rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.notification-feedback p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.success-feedback {
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.notification-feedback-icon {
  font-size: 1.2rem;
  margin-top: 2px;
}

.manager-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.chart-card-header {
  padding: 16px 16px 0;
}

.chart-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.chart-card-header p {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.chart-card-body {
  padding: 12px 16px 16px;
}

.chart-canvas {
  width: 100%;
  min-height: 240px;
  display: block;
}

.chart-canvas-small {
  min-height: 180px;
}

.avg-resolution-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.avg-resolution-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.avg-resolution-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .manager-charts-grid {
    grid-template-columns: 1fr;
  }
}

.export-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.export-card strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 4px;
}

.export-card p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.export-btn {
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--bg-card);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.export-btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.export-btn-secondary {
  background: var(--bg);
  color: var(--primary);
  border: 1px solid var(--border);
}

.export-btn-secondary:hover {
  background: rgba(27, 73, 101, 0.05);
}

@media (max-width: 640px) {
  .export-card {
    flex-direction: column;
    align-items: stretch;
  }

  .export-actions {
    width: 100%;
  }

  .export-btn {
    flex: 1;
  }
}
