/* ════════════════════════════════════════
   ALLYTRIZ — TAACAD CSR PORTAL
   Shared Stylesheet
════════════════════════════════════════ */

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

:root {
  --c-bg: #F9F8F5;
  --c-surface: #FFFFFF;
  --c-text: #0E0E0E;
  --c-muted: #6B6B6B;
  --c-subtle: #A8A8A8;
  --c-border: #E4E2DC;
  --c-accent: #1A1A1A;
  --c-teal: #26778c;
  --c-teal-light: #E8F3F6;
  --c-teal-mid: #3A9AB3;
  --c-success: #16a34a;
  --c-success-light: #dcfce7;
  --c-warn: #d97706;
  --c-warn-light: #fef3c7;
  --c-danger: #dc2626;
  --c-danger-light: #fee2e2;
  --nav-h: 62px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }

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

/* ── NAVIGATION ── */
.app-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(249,248,245,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%;
}
.nav-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--c-text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 0.5rem;
}
.nav-brand span { color: var(--c-teal); }
.nav-brand img { height: 40px; width: auto; object-fit: contain; }
.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.nav-badge {
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c-teal); background: var(--c-teal-light);
  padding: 0.22rem 0.75rem; border-radius: 100px;
}
.nav-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem; font-weight: 500;
  padding: 0.4rem 1rem; border-radius: 100px;
  border: 1px solid var(--c-border); background: transparent; color: var(--c-text);
  cursor: pointer; transition: all 0.2s; text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem;
}
.nav-btn:hover { border-color: var(--c-teal); color: var(--c-teal); }
.nav-btn.notif-btn { position: relative; }
.nav-btn .notif-dot {
  position: absolute; top: -3px; right: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--c-danger); border: 2px solid var(--c-bg);
  display: none;
}
.nav-btn .notif-dot.show { display: block; }

/* ── PAGE WRAPPER ── */
.page {
  padding: calc(var(--nav-h) + 2.5rem) 5% 4rem;
  max-width: 1100px;
  margin: 0 auto;
}
.page.narrow { max-width: 680px; }
.page.wide { max-width: 1240px; }
.page.centered {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: 'DM Serif Display', serif; letter-spacing: -0.025em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); line-height: 1.12; }
h3 { font-size: 1.15rem; font-weight: 400; }
.tag {
  display: inline-block; font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--c-teal); background: var(--c-teal-light);
  padding: 0.28rem 0.8rem; border-radius: 100px;
  margin-bottom: 0.85rem;
}
.lead { font-size: 1.05rem; color: var(--c-muted); line-height: 1.75; }
.muted { color: var(--c-muted); }
.teal { color: var(--c-teal); }
.sm { font-size: 0.875rem; }
.xs { font-size: 0.78rem; }

/* ── CARDS ── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.card-sm {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
}
.card-teal {
  background: var(--c-teal-light);
  border: 1px solid rgba(38,119,140,0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 1.1rem; }
.form-group label,
.field-label {
  display: block; font-size: 0.75rem; font-weight: 500;
  color: var(--c-muted); letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 0.38rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem; color: var(--c-text);
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 0.72rem 0.95rem;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  resize: none; appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--c-teal);
  box-shadow: 0 0 0 3px rgba(38,119,140,0.09);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.req { color: #c0392b; margin-left: 2px; }
.field-hint { font-size: 0.74rem; color: var(--c-subtle); margin-top: 4px; line-height: 1.5; }

/* ── PILLS (radio/checkbox) ── */
.pill-group { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0.42rem 1rem; border: 1px solid var(--c-border);
  border-radius: 100px; cursor: pointer;
  font-size: 0.8125rem; color: var(--c-text); background: var(--c-surface);
  transition: all 0.12s; user-select: none; font-family: 'DM Sans', sans-serif;
}
.pill input { display: none; }
.pill:hover { border-color: var(--c-teal); background: var(--c-teal-light); }
.pill.on { border: 2px solid var(--c-teal); background: var(--c-teal-light); color: var(--c-teal); font-weight: 500; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; font-weight: 500;
  padding: 0.72rem 1.6rem; border-radius: 100px;
  cursor: pointer; transition: all 0.2s;
  text-decoration: none; border: none; line-height: 1;
}
.btn-p { background: var(--c-text); color: white; }
.btn-p:hover { background: var(--c-teal); transform: translateY(-1px); }
.btn-s { background: transparent; color: var(--c-text); border: 1px solid var(--c-border); }
.btn-s:hover { border-color: var(--c-muted); transform: translateY(-1px); }
.btn-t { background: var(--c-teal); color: white; }
.btn-t:hover { background: #1f6275; transform: translateY(-1px); }
.btn-d { background: var(--c-danger); color: white; }
.btn-d:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-g { background: var(--c-success); color: white; }
.btn-g:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none !important; }
.btn-sm { font-size: 0.78rem; padding: 0.35rem 0.85rem; }

/* ── STEPPER ── */
.stepper {
  display: flex; align-items: flex-start;
  margin-bottom: 2.5rem; overflow-x: auto;
  padding-bottom: 0.5rem; scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.step-item { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; min-width: 70px; }
.step-item:not(:last-child)::after {
  content: ''; position: absolute;
  top: 15px; left: 55%; width: 90%; height: 2px;
  background: var(--c-border); z-index: 0; transition: background 0.35s;
}
.step-item.done:not(:last-child)::after { background: var(--c-text); }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 600;
  background: var(--c-bg); border: 2px solid var(--c-border); color: var(--c-muted);
  flex-shrink: 0; transition: all 0.3s; z-index: 1; position: relative;
}
.step-circle.active { background: var(--c-teal); border-color: var(--c-teal); color: white; }
.step-circle.done { background: var(--c-text); border-color: var(--c-text); color: white; }
.step-label { font-size: 0.68rem; color: var(--c-muted); margin-top: 6px; text-align: center; white-space: nowrap; }
.step-panel { display: none; }
.step-panel.active { display: block; }

/* ── TABS ── */
.tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--c-border);
  margin-bottom: 2rem; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem; font-weight: 500; color: var(--c-muted);
  padding: 0.75rem 1.25rem; border: none; background: transparent;
  cursor: pointer; border-bottom: 2.5px solid transparent;
  margin-bottom: -2px; transition: all 0.2s; white-space: nowrap;
}
.tab:hover { color: var(--c-text); }
.tab.active { color: var(--c-teal); border-bottom-color: var(--c-teal); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── STATS ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-md); padding: 1.1rem 1.3rem;
}
.stat .n {
  font-family: 'DM Serif Display', serif; font-size: 1.9rem;
  color: var(--c-text); line-height: 1;
}
.stat .l { font-size: 0.75rem; color: var(--c-muted); margin-top: 4px; }
.stat.hi { background: var(--c-teal); border-color: var(--c-teal); }
.stat.hi .n, .stat.hi .l { color: white; }
.stat.dark { background: var(--c-text); border-color: var(--c-text); }
.stat.dark .n, .stat.dark .l { color: white; }

/* ── BADGES ── */
.badge {
  display: inline-block; font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.2rem 0.65rem; border-radius: 100px;
}
.b-pend { background: var(--c-warn-light); color: var(--c-warn); }
.b-approv { background: var(--c-success-light); color: var(--c-success); }
.b-reject { background: var(--c-danger-light); color: var(--c-danger); }
.b-active { background: var(--c-teal-light); color: var(--c-teal); }
.b-open { background: #EFF6FF; color: #2563EB; }
.b-partial { background: var(--c-warn-light); color: var(--c-warn); }
.b-funded { background: var(--c-success-light); color: var(--c-success); }

/* ── ALERTS ── */
.alert {
  padding: 0.9rem 1.1rem; border-radius: var(--radius-md);
  font-size: 0.875rem; margin-bottom: 1.25rem;
  display: flex; gap: 0.75rem; align-items: flex-start; line-height: 1.6;
}
.a-info { background: var(--c-teal-light); color: var(--c-teal); border: 1px solid rgba(38,119,140,0.2); }
.a-warn { background: var(--c-warn-light); color: var(--c-warn); border: 1px solid rgba(217,119,6,0.2); }
.a-success { background: var(--c-success-light); color: var(--c-success); border: 1px solid rgba(22,163,74,0.2); }
.a-danger { background: var(--c-danger-light); color: var(--c-danger); border: 1px solid rgba(220,38,38,0.2); }

/* ── TABLE ── */
.tbl-wrap {
  overflow-x: auto; border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
}
table { width: 100%; border-collapse: collapse; background: var(--c-surface); font-size: 0.86rem; }
thead th {
  background: var(--c-bg); color: var(--c-muted);
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
tbody td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--c-border); color: var(--c-text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--c-bg); }

/* ── PROGRESS BAR ── */
.progress-bar { height: 7px; background: var(--c-border); border-radius: 100px; overflow: hidden; margin: 0.6rem 0; }
.progress-fill { height: 100%; background: var(--c-teal); border-radius: 100px; transition: width 0.6s ease; }

/* ── DEMAND CARD ── */
.demand-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 18px; padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.demand-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.demand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.25rem; }

/* ── UPLOAD BOX ── */
.upload-box {
  border: 1.5px dashed var(--c-border); border-radius: var(--radius-md);
  padding: 1.5rem; text-align: center; cursor: pointer;
  background: var(--c-bg); transition: all 0.15s; position: relative;
  margin-top: 0.4rem;
}
.upload-box:hover, .upload-box.has-file { border-color: var(--c-teal); background: var(--c-teal-light); }
.upload-box input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.upload-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.upload-title { font-size: 0.85rem; font-weight: 500; color: var(--c-text); margin-bottom: 3px; }
.upload-sub { font-size: 0.75rem; color: var(--c-muted); }
.upload-box.has-file .upload-title { color: var(--c-teal); }

/* ── KP SLIDER ── */
.kp-slider-wrap { position: relative; overflow: hidden; border: 1px solid var(--c-border); border-radius: 20px; }
.kp-slider-track { display: flex; transition: transform 0.35s cubic-bezier(.4,0,.2,1); will-change: transform; }
.kp-slide { min-width: 100%; padding: 2rem; }
.slider-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; border-top: 1px solid var(--c-border); background: var(--c-bg);
}
.slider-dots { display: flex; gap: 6px; align-items: center; }
.sdot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--c-border);
  cursor: pointer; transition: all 0.25s;
}
.sdot.on { background: var(--c-teal); width: 22px; border-radius: 4px; }
.sarr {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--c-border);
  background: var(--c-surface); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: all 0.2s;
}
.sarr:hover { border-color: var(--c-teal); color: var(--c-teal); }

/* ── NOTIFICATIONS ── */
.notif-item {
  display: flex; gap: 1rem; padding: 1rem 0;
  border-bottom: 1px solid var(--c-border); align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.ndot { width: 9px; height: 9px; border-radius: 50%; background: var(--c-subtle); flex-shrink: 0; margin-top: 5px; }
.ndot.unread { background: var(--c-danger); }
.notif-item h5 { font-size: 0.875rem; font-weight: 500; margin-bottom: 3px; }
.notif-item p { font-size: 0.8rem; color: var(--c-muted); line-height: 1.5; }
.notif-item time { font-size: 0.7rem; color: var(--c-subtle); display: block; margin-top: 3px; }

/* ── INFO ROW ── */
.info-row { display: flex; gap: 2rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.info-item .il { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-subtle); margin-bottom: 2px; }
.info-item .iv { font-size: 0.9rem; color: var(--c-text); font-weight: 500; }

/* ── MODAL ── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.42); z-index: 200;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--c-surface); border-radius: 22px;
  padding: 2rem; max-width: 460px; width: 100%; position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.96) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal h3 { margin-bottom: 1rem; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; cursor: pointer; color: var(--c-muted);
  font-size: 1.1rem; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.modal-close:hover { background: var(--c-bg); color: var(--c-text); }

/* ── UTILITY ── */
hr { border: none; border-top: 1px solid var(--c-border); margin: 1.75rem 0; }
.flex-b { display: flex; justify-content: space-between; align-items: center; }
.flex-g { display: flex; gap: 0.75rem; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.chip {
  display: inline-block; font-size: 0.72rem;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: 100px; padding: 0.2rem 0.65rem; color: var(--c-muted);
}
.mt1 { margin-top: 0.5rem; }
.mt2 { margin-top: 1rem; }
.mt3 { margin-top: 1.5rem; }
.mt4 { margin-top: 2rem; }
.mb1 { margin-bottom: 0.5rem; }
.mb2 { margin-bottom: 1rem; }
.mb3 { margin-bottom: 1.5rem; }
.mb4 { margin-bottom: 2rem; }
.sh { margin-bottom: 1.75rem; }
.sh h2, .sh h3 { margin-bottom: 0.35rem; }
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--c-muted); }
.empty .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; }
.empty p { font-size: 0.9rem; }
.text-center { text-align: center; }

/* ── HOME PAGE ── */
.home-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: calc(var(--nav-h)+2rem) 5% 4rem; text-align: center;
}
.home-wrap h1 { margin-bottom: 1rem; }
.home-wrap h1 em { color: var(--c-teal); font-style: italic; }
.home-wrap .lead { margin: 0 auto 3rem; max-width: 520px; }
.role-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; max-width: 900px; width: 100%; }
.role-card {
  background: var(--c-surface); border: 1.5px solid var(--c-border);
  border-radius: 24px; padding: 2.25rem 1.75rem; text-align: center;
  cursor: pointer; transition: all 0.28s;
  display: flex; flex-direction: column; gap: 0.9rem; align-items: center;
  text-decoration: none; color: inherit;
}
.role-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg); border-color: var(--c-teal);
}
.role-icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--c-teal-light);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s;
}
.role-card:hover .role-icon { background: var(--c-teal); }
.role-icon svg { width: 30px; height: 30px; color: var(--c-teal); transition: color 0.25s; }
.role-card:hover .role-icon svg { color: white; }
.role-card h3 { font-family: 'DM Serif Display', serif; font-size: 1.15rem; }
.role-card p { font-size: 0.82rem; color: var(--c-muted); line-height: 1.6; }
.role-cta { font-size: 0.8rem; font-weight: 500; color: var(--c-teal); margin-top: auto; }
.home-help { margin-top: 2.5rem; font-size: 0.875rem; color: var(--c-muted); }
.home-help a { color: var(--c-teal); text-decoration: none; }
.home-help a:hover { text-decoration: underline; }

/* ── LOGIN PAGE ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: calc(var(--nav-h)+2rem) 5% 4rem;
}
.login-card { width: 100%; max-width: 440px; }

/* ── SECTION HEADING ── */
.section-head { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--c-border); }
.section-head h2 { margin-bottom: 0.3rem; }

/* ── DASHBOARD HEADER ── */
.dash-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.dash-header-left .tag { margin-bottom: 0.4rem; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .role-grid { grid-template-columns: 1fr; max-width: 480px; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .demand-grid { grid-template-columns: 1fr; }
  .page { padding: calc(var(--nav-h)+1.5rem) 4% 3rem; }
}
@media (max-width: 600px) {
  .role-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .card { padding: 1.5rem; }
  h1 { font-size: 1.9rem; }
}
