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

:root {
  --blue: #185FA5;
  --blue-dark: #0C447C;
  --blue-light: #E6F1FB;
  --green: #3B6D11;
  --green-light: #EAF3DE;
  --amber: #854F0B;
  --amber-light: #FAEEDA;
  --red: #A32D2D;
  --red-light: #FCEBEB;
  --gray-50: #F9F9F8;
  --gray-100: #F1EFE8;
  --gray-300: #D3D1C7;
  --gray-500: #888780;
  --gray-700: #444441;
  --gray-900: #2C2C2A;
  --text: #2C2C2A;
  --text-secondary: #5F5E5A;
  --text-tertiary: #888780;
  --border: #D3D1C7;
  --border-light: #EBEBEB;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--gray-50);
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.nav {
  background: white;
  border-bottom: 1px solid var(--border-light);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand svg { width: 22px; height: 22px; color: var(--blue); }

/* Page containers */
.page-container {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}
.page-container-wide {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

/* Cards */
.card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}
.card-header { margin-bottom: 1.5rem; }
.card-header h1 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.card-header p { font-size: 14px; color: var(--text-secondary); }

/* Form elements */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.required { color: var(--red); }
.optional { font-weight: 400; color: var(--text-tertiary); }

input[type=text],
input[type=email],
input[type=date],
select,
textarea {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.1);
}
input:disabled, select:disabled { background: var(--gray-100); color: var(--text-tertiary); cursor: not-allowed; }
textarea { height: 100px; padding: 8px 10px; resize: vertical; line-height: 1.5; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.location-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Priority hint */
.priority-hint {
  font-size: 12px;
  margin-top: 5px;
  padding: 6px 9px;
  border-radius: var(--radius);
  display: none;
}
.priority-hint.visible { display: block; }
.hint-low { background: var(--green-light); color: var(--green); }
.hint-moderate { background: var(--amber-light); color: var(--amber); }
.hint-critical { background: var(--red-light); color: var(--red); }

/* Other location input */
.other-field { margin-top: 8px; display: none; }
.other-field.visible { display: block; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--blue); color: white; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-primary:disabled { background: var(--gray-300); border-color: var(--gray-300); cursor: not-allowed; }
.btn-secondary { background: white; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-full { width: 100%; margin-top: 1.25rem; }

/* Alerts */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 1.25rem;
  display: none;
}
.alert.visible { display: block; }
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #C0DD97; }
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid #F7C1C1; }
.alert strong { display: block; font-weight: 600; margin-bottom: 2px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.badge-low { background: var(--green-light); color: var(--green); }
.badge-moderate { background: var(--amber-light); color: var(--amber); }
.badge-critical { background: var(--red-light); color: var(--red); }
.badge-awaiting { background: var(--gray-100); color: var(--text-secondary); }
.badge-planning { background: var(--blue-light); color: var(--blue); }
.badge-inprogress { background: var(--amber-light); color: var(--amber); }
.badge-complete { background: var(--green-light); color: var(--green); }
.badge-closed { background: var(--gray-100); color: var(--text-secondary); }
.badge-cat { background: var(--gray-100); color: var(--text-secondary); }

/* Login wall */
.login-wall {
  max-width: 380px;
  margin: 4rem auto;
  padding: 0 1rem;
  text-align: center;
}
.login-wall .card { padding: 2rem; }
.login-wall h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.login-wall p { font-size: 14px; color: var(--text-secondary); margin-bottom: 1.5rem; }
.ms-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}
.ms-btn:hover { background: var(--gray-100); }

/* Admin layout */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-header h1 { font-size: 20px; font-weight: 600; }
.admin-user { font-size: 13px; color: var(--text-secondary); }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.25rem;
}
.filters select { width: auto; height: 32px; font-size: 13px; padding: 0 8px; }
.filter-label { font-size: 13px; color: var(--text-secondary); }

/* Request cards */
.requests-list { display: flex; flex-direction: column; gap: 8px; }
.empty-state { font-size: 14px; color: var(--text-secondary); padding: 2rem 0; text-align: center; }

.request-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s;
  border-left-width: 3px;
  border-left-style: solid;
}
.request-card:hover { border-color: var(--border); border-left-color: inherit; }
.request-card.expanded { border-color: var(--blue); border-left-color: inherit; }
.request-card.priority-low { border-left-color: #639922; }
.request-card.priority-moderate { border-left-color: #BA7517; }
.request-card.priority-critical { border-left-color: var(--red); }

.rc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rc-title { font-size: 14px; font-weight: 500; }
.rc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.rc-right { text-align: right; flex-shrink: 0; }
.rc-assignee { font-size: 12px; color: var(--text-secondary); }
.rc-date { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* Request detail */
.rc-detail {
  margin-top: 1rem;
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
  display: none;
}
.rc-detail.visible { display: block; }
.rc-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1rem; }
.detail-field label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 4px;
}
.detail-field select,
.detail-field input[type=date] { height: 32px; font-size: 13px; }
.detail-field textarea { height: 80px; font-size: 13px; }
.detail-full { grid-column: 1 / -1; }
.priority-original { font-size: 11px; color: var(--text-tertiary); font-weight: 400; margin-left: 4px; }

.rc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 8px;
}
.rc-submitter { font-size: 12px; color: var(--text-tertiary); }

/* Closed justification */
.justification-field { display: none; margin-top: 12px; }
.justification-field.visible { display: block; }
.justification-field label {
  font-size: 11px;
  font-weight: 500;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 4px;
}

/* Save feedback */
.save-feedback { font-size: 13px; color: var(--green); display: none; }
.save-feedback.visible { display: inline; }