/* ChairReady App Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --warm-black: #1a1614;
  --cream: #faf6f1;
  --rose: #c4736e;
  --rose-light: #e8a9a0;
  --champagne: #d4b896;
  --soft-white: #fefcfa;
  --muted: #8a7e76;
  --accent-dark: #2d2420;
  --green: #5a9e6f;
  --green-light: #e8f5e9;
  --red: #c0504d;
  --red-light: #fce4e4;
  --yellow: #d4a04a;
  --yellow-light: #fff8e7;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--cream);
  color: var(--warm-black);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Nav */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  backdrop-filter: blur(20px);
  background: rgba(250, 246, 241, 0.9);
  border-bottom: 1px solid rgba(196, 115, 110, 0.1);
}
.logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.3rem; color: var(--warm-black); text-decoration: none; }
.logo span { color: var(--rose); }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.88rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--warm-black); }
.nav-user { font-weight: 600; color: var(--warm-black); font-size: 0.88rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.4rem; border-radius: 100px;
  font-weight: 600; font-size: 0.88rem;
  text-decoration: none; transition: all 0.2s;
  cursor: pointer; border: none; font-family: inherit;
}
.btn-primary { background: var(--rose); color: white; }
.btn-primary:hover { background: #b5625d; }
.btn-secondary { background: transparent; color: var(--warm-black); border: 1.5px solid rgba(26,22,20,0.15); }
.btn-secondary:hover { border-color: var(--rose); color: var(--rose); }
.btn-small { padding: 0.4rem 1rem; font-size: 0.82rem; }
.btn-full { width: 100%; padding: 0.85rem; font-size: 0.95rem; }
.btn-ghost { background: none; border: none; color: var(--muted); padding: 0.4rem 0.8rem; }
.btn-ghost:hover { color: var(--rose); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #a84240; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Auth Pages */
.auth-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 6rem 1.5rem 2rem;
}
.auth-card {
  background: var(--soft-white); border-radius: 24px; padding: 3rem;
  max-width: 420px; width: 100%;
  border: 1px solid rgba(196, 115, 110, 0.08);
  box-shadow: 0 8px 40px rgba(26, 22, 20, 0.04);
}
.auth-card h1 {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.8rem;
  margin-bottom: 0.3rem;
}
.auth-subtitle { color: var(--muted); font-size: 0.95rem; margin-bottom: 2rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.88rem; color: var(--muted); }
.auth-footer a { color: var(--rose); text-decoration: none; font-weight: 600; }

/* Forms */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.4rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.75rem 1rem; border-radius: 12px;
  border: 1.5px solid rgba(26, 22, 20, 0.1);
  font-family: inherit; font-size: 0.95rem;
  background: var(--cream); transition: border-color 0.2s;
  color: var(--warm-black);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--rose);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Error message */
.error-msg {
  background: var(--red-light); color: var(--red); padding: 0.8rem 1rem;
  border-radius: 12px; font-size: 0.88rem; font-weight: 500; margin-bottom: 1.2rem;
}
.success-msg {
  background: var(--green-light); color: var(--green); padding: 0.8rem 1rem;
  border-radius: 12px; font-size: 0.88rem; font-weight: 500; margin-bottom: 1.2rem;
}

/* Dashboard Layout */
.app-layout {
  padding-top: 4.5rem; min-height: 100vh;
}
.app-content {
  max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem;
}
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.page-header h1 {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.8rem;
  letter-spacing: -0.02em;
}

/* Stats Grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--soft-white); border-radius: 16px; padding: 1.5rem;
  border: 1px solid rgba(196, 115, 110, 0.08);
}
.stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 0.3rem; }
.stat-value { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 2rem; color: var(--warm-black); }
.stat-value.rose { color: var(--rose); }
.stat-value.green { color: var(--green); }

/* Cards */
.card {
  background: var(--soft-white); border-radius: 20px; padding: 1.5rem;
  border: 1px solid rgba(196, 115, 110, 0.08);
  margin-bottom: 1.5rem;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem;
}
.card-header h2 { font-weight: 700; font-size: 1.1rem; }

/* Tables */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0.8rem 1rem; border-bottom: 1px solid rgba(26, 22, 20, 0.06); }
td { padding: 0.8rem 1rem; font-size: 0.9rem; border-bottom: 1px solid rgba(26, 22, 20, 0.04); }
tr:hover td { background: rgba(196, 115, 110, 0.02); }
.clickable-row { cursor: pointer; }

/* Progress bars */
.progress-bar { height: 8px; background: rgba(196, 115, 110, 0.1); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; transition: width 0.8s ease; }
.fill-rose { background: linear-gradient(90deg, var(--rose), var(--rose-light)); }
.fill-green { background: linear-gradient(90deg, var(--green), #7ab889); }
.fill-yellow { background: linear-gradient(90deg, var(--yellow), #e0b85a); }
.fill-champagne { background: linear-gradient(90deg, var(--champagne), #e0c9a8); }
.fill-muted { background: linear-gradient(90deg, var(--muted), #a89e96); }

/* Tags/Badges */
.badge {
  display: inline-flex; padding: 0.2rem 0.7rem; border-radius: 100px;
  font-size: 0.75rem; font-weight: 600;
}
.badge-active { background: var(--green-light); color: var(--green); }
.badge-graduated { background: rgba(196, 115, 110, 0.1); color: var(--rose); }
.badge-withdrawn { background: rgba(26, 22, 20, 0.06); color: var(--muted); }
.badge-pass { background: var(--green-light); color: var(--green); }
.badge-fail { background: var(--red-light); color: var(--red); }

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 22, 20, 0.5); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; backdrop-filter: blur(4px);
}
.modal {
  background: var(--soft-white); border-radius: 24px; padding: 2rem;
  max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(26, 22, 20, 0.15);
}
.modal h2 {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.3rem;
  margin-bottom: 1.5rem;
}
.modal-actions { display: flex; gap: 0.8rem; justify-content: flex-end; margin-top: 1.5rem; }

/* Empty states */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-weight: 700; color: var(--warm-black); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.95rem; margin-bottom: 1.5rem; }

/* Utility */
.text-muted { color: var(--muted); }
.text-rose { color: var(--rose); }
.text-green { color: var(--green); }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  nav { padding: 0.8rem 1rem; }
  .app-content { padding: 1.5rem 1rem; }
  .page-header h1 { font-size: 1.4rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .modal { padding: 1.5rem; border-radius: 20px; }
  .auth-card { padding: 2rem; }
  table { font-size: 0.85rem; }
  th, td { padding: 0.6rem 0.7rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
