@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;1,600&display=swap');

:root {
  --paper: #f5f1e8;
  --paper-2: #ede6da;
  --surface: #fffdf8;
  --surface-2: #f8f4ec;
  --ink: #17231f;
  --muted: #718078;
  --line: #ded8cc;
  --forest: #163b32;
  --forest-2: #235649;
  --mint: #a7d9c7;
  --lime: #d9ef9d;
  --amber: #f3c778;
  --coral: #ee8c72;
  --blue: #9ab7e8;
  --violet: #baa8df;
  --danger: #b85048;
  --shadow-sm: 0 1px 0 rgba(23,35,31,.04), 0 8px 24px rgba(23,35,31,.05);
  --shadow: 0 24px 70px rgba(23,35,31,.12);
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 34px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  min-width: 320px;
  background:
    radial-gradient(circle at 10% 0%, rgba(167,217,199,.28), transparent 30rem),
    linear-gradient(180deg, #f7f4ed 0%, var(--paper) 100%);
  color: var(--ink);
  font-family: 'DM Sans','Noto Kufi Arabic',sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .26;
  background-image: radial-gradient(rgba(22,59,50,.18) .55px, transparent .55px);
  background-size: 16px 16px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.28), transparent 68%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { color: inherit; }
::selection { background: var(--lime); color: var(--forest); }

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0,1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px 22px;
  display: flex;
  flex-direction: column;
  color: #f7f4ed;
  background:
    radial-gradient(circle at 20% 0%, rgba(167,217,199,.13), transparent 24rem),
    linear-gradient(180deg, #112a24 0%, #0e241f 100%);
  border-right: 1px solid rgba(255,255,255,.06);
  overflow: auto;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px 15px 15px 7px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg,var(--lime),var(--mint));
  color: #17352d;
  font-size: 19px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}
.brand strong { display: block; letter-spacing: .14em; font-size: 13px; }
.brand small { display: block; margin-top: 1px; color: #83a398; font-size: 10px; letter-spacing: .05em; }
.sidebar nav { display: grid; gap: 4px; margin-top: 36px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 14px;
  color: #9cb7ae;
  font-size: 13px;
  font-weight: 600;
  transition: .18s ease;
}
.sidebar nav a span { width: 24px; text-align: center; font-size: 16px; }
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.055); }
.sidebar nav a.active {
  color: #163b32;
  background: var(--lime);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.nav-label {
  margin: 28px 12px 0;
  color: #65877b;
  font-size: 9px;
  letter-spacing: .18em;
  font-weight: 700;
}
.sidebar-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.09);
}
.sidebar-foot > a { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #244b41;
  color: var(--lime);
  font-weight: 800;
}
.sidebar-foot b,.sidebar-foot small { display: block; }
.sidebar-foot b { font-size: 12px; }
.sidebar-foot small { margin-top: 2px; color: #718f85; font-size: 10px; }

.main-area { min-width: 0; }
.topbar {
  min-height: 98px;
  padding: 20px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(222,216,204,.9);
  background: rgba(247,244,237,.88);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar h1 { margin: 3px 0 0; font-size: clamp(22px,2vw,28px); letter-spacing: -.035em; }
.eyebrow { margin: 0; color: #829087; font-size: 9px; letter-spacing: .16em; font-weight: 800; text-transform: uppercase; }
.top-actions { display: flex; gap: 8px; }
.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,253,248,.92);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.6);
}
.notification-button i {
  position: absolute;
  right: -4px;
  top: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--coral);
  color: #fff;
  font-style: normal;
  font-size: 9px;
  display: grid;
  place-items: center;
  border: 2px solid var(--paper);
}
.mobile-menu { display: none; }
.content { width: min(1440px,100%); padding: 34px 38px 64px; }

.welcome {
  min-height: 220px;
  border-radius: var(--radius-lg);
  padding: 34px 38px;
  color: #fffdf8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 10%, rgba(217,239,157,.18), transparent 18rem),
    linear-gradient(125deg,#173d33 0%,#234f43 52%,#17372f 100%);
  box-shadow: var(--shadow-sm);
}
.welcome::before,
.welcome::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(217,239,157,.16);
}
.welcome::before { width: 320px; height: 320px; right: 11%; top: -225px; box-shadow: 0 0 0 42px rgba(217,239,157,.03),0 0 0 84px rgba(217,239,157,.02); }
.welcome::after { width: 120px; height: 120px; right: 34%; bottom: -90px; }
.welcome > * { position: relative; z-index: 2; }
.welcome h2 { margin: 12px 0 7px; font-family: 'Playfair Display',serif; font-size: clamp(31px,3vw,44px); letter-spacing: -.035em; }
.welcome p { margin: 0; color: #bed1c9; max-width: 620px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #173c33;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.badge.soft { background: #edf0d5; color: #50623d; }
.badge.success { background: #def1e4; color: #2d684f; }
.welcome .soft { background: rgba(217,239,157,.14); color: var(--lime); border: 1px solid rgba(217,239,157,.16); }
.streak {
  min-width: 128px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.065);
  padding: 22px 24px;
  border-radius: 24px;
  backdrop-filter: blur(8px);
}
.streak b { display: block; font-size: 38px; color: var(--lime); letter-spacing: -.05em; }
.streak span { font-size: 10px; color: #b1c8bf; }

.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin: 18px 0; }
.metric {
  min-height: 140px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,253,248,.86);
  box-shadow: var(--shadow-sm);
}
.metric::before { content: ''; display: block; width: 34px; height: 6px; border-radius: 999px; background: var(--mint); margin-bottom: 18px; }
.metric.blue::before { background: var(--blue); }
.metric.violet::before { background: var(--violet); }
.metric.sand::before { background: var(--amber); }
.metric small,.metric span { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; font-size: 29px; letter-spacing: -.04em; margin: 5px 0; }
.dashboard-grid { display: grid; grid-template-columns: 1.22fr .78fr; gap: 18px; }

.panel,.subject-card,.room-card,.post-card,.opportunity-card,.profile-card {
  background: rgba(255,253,248,.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel { padding: 25px; }
.panel-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 18px; }
.panel-head h3 { margin: 2px 0; font-size: 18px; letter-spacing: -.02em; }
.panel-head > a,.room-link { font-size: 11px; color: var(--forest-2); font-weight: 700; }
.learning-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 13px; padding: 16px 0; border-top: 1px solid var(--line); align-items: center; }
.subject-dot { width: 8px; height: 38px; border-radius: 999px; background: var(--mint); }
.learning-row b,.learning-row span { display: block; }
.learning-row span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.learning-row .arrow { margin: 0; font-size: 17px; color: var(--forest-2); }
.timeline-item { display: grid; grid-template-columns: 68px 1fr; gap: 11px; padding: 15px 0; border-top: 1px solid var(--line); }
.timeline-item time { color: #9c6d35; font-size: 10px; font-weight: 800; }
.timeline-item b,.timeline-item span { display: block; }
.timeline-item span { margin-top: 3px; color: var(--muted); font-size: 10px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.search {
  min-width: min(340px,100%);
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,253,248,.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
}
.search input { width: 100%; padding: 11px 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.button {
  border: 0;
  border-radius: 14px;
  background: var(--forest);
  color: #fff;
  padding: 12px 18px;
  min-height: 44px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(22,59,50,.13);
  transition: transform .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); background: var(--forest-2); }
.button.small { min-height: 38px; padding: 9px 14px; font-size: 11px; }
.button.secondary { background: #ebe6db; color: #35423d; box-shadow: none; }
.button.wide,.wide { width: 100%; }
.text-button { border: 0; background: none; color: inherit; font-weight: 700; cursor: pointer; }
.danger-button { width: 100%; margin-top: 10px; border: 1px solid #eccac4; background: #fff5f2; color: var(--danger); padding: 12px; border-radius: 14px; font-weight: 700; }

.subject-grid,.room-grid,.opportunity-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.subject-card,.room-card,.opportunity-card { min-height: 235px; padding: 22px; transition: .18s ease; }
.subject-card:hover,.room-card:hover,.opportunity-card:hover { transform: translateY(-3px); border-color: #c7c0b4; box-shadow: var(--shadow); }
.subject-card-top,.room-head,.opp-top,.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subject-code { font-size: 9px; font-weight: 800; letter-spacing: .14em; color: #7d877f; }
.subject-card h3,.room-card h3,.opportunity-card h3 { margin: 19px 0 8px; font-size: 19px; letter-spacing: -.025em; }
.subject-card p,.room-card p,.opportunity-card p { color: var(--muted); font-size: 11px; line-height: 1.75; }
.card-meta { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.progress-ring { --p:0; width: 49px; height: 49px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--forest-2) calc(var(--p)*1%),#e7e2d9 0); position: relative; }
.progress-ring::after { content: ''; position: absolute; inset: 5px; background: var(--surface); border-radius: 50%; }
.progress-ring span { position: relative; z-index: 1; font-size: 9px; font-weight: 800; }

.schedule-board { display: grid; gap: 10px; }
.schedule-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 15px; padding: 18px 20px; background: rgba(255,253,248,.94); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.schedule-row.done { opacity: .55; }
.schedule-row.done h3 { text-decoration: line-through; }
.schedule-row h3 { margin: 3px 0; font-size: 15px; }
.schedule-row small,.schedule-row span { color: var(--muted); font-size: 10px; }
.check { width: 31px; height: 31px; border-radius: 10px; border: 1px solid #c9d3ce; background: var(--surface); color: var(--forest); }
.more { border: 0; background: transparent; color: #879188; }
.segmented { display: flex; padding: 3px; border-radius: 12px; background: #e8e2d7; }
.segmented button { border: 0; background: transparent; padding: 8px 13px; border-radius: 9px; color: #7d847f; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 7px rgba(0,0,0,.05); }

.feed { display: grid; gap: 14px; max-width: 900px; }
.post-card { padding: 22px; }
.post-author { display: flex; align-items: center; gap: 10px; }
.post-author .badge { margin-inline-start: auto; }
.post-author b,.post-author small { display: block; }
.post-author small { color: var(--muted); font-size: 9px; }
.post-card h3 { margin: 19px 0 8px; font-size: 18px; }
.post-card p { color: #57645f; line-height: 1.75; font-size: 12px; }
.post-card footer { display: flex; gap: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.post-card footer button { border: 0; background: none; color: inherit; }
.member-stack { display: flex; margin: 18px 0; }
.member-stack span { width: 29px; height: 29px; border-radius: 10px; display: grid; place-items: center; background: #e4ebe7; border: 2px solid var(--surface); margin-inline-start: -5px; font-size: 9px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { padding: 6px 8px; border-radius: 8px; background: #eee9df; color: #68726c; font-size: 9px; }
.category-tabs { display: flex; gap: 7px; margin-bottom: 20px; }
.category-tabs a { padding: 9px 14px; border-radius: 11px; color: #78847d; font-size: 11px; font-weight: 700; }
.category-tabs a.active { background: var(--forest); color: #fff; }

.course-list { display: grid; gap: 10px; }
.course-row { padding: 16px; border: 1px solid var(--line); border-radius: 17px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.course-row > div { display: flex; gap: 12px; align-items: center; }
.course-row.active { border-color: #a9cbbc; background: #f0f7f2; }
.course-row h3,.course-row p { margin: 0; }
.course-row p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.position { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: #ebe6dd; font-weight: 800; }

.profile-layout { display: grid; grid-template-columns: 290px 1fr; gap: 18px; }
.profile-card { text-align: center; padding: 34px 22px; }
.profile-avatar { width: 96px; height: 96px; border-radius: 30px 30px 30px 13px; margin: 0 auto 18px; display: grid; place-items: center; background: linear-gradient(145deg,var(--forest),#5c8b7b); color: var(--lime); font-size: 34px; font-weight: 800; }
.profile-card h2 { margin: 0; }
.profile-card p { color: var(--muted); }
.detail-list { display: grid; }
.detail-list > div { display: grid; grid-template-columns: 160px 1fr; padding: 16px 0; border-top: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 10px; }
.detail-list dd { margin: 0; font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; }
.setting-row { display: flex; justify-content: space-between; gap: 25px; padding: 17px 0; border-top: 1px solid var(--line); align-items: center; }
.setting-row b,.setting-row small { display: block; }
.setting-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.setting-row input[type=checkbox] { width: 42px; height: 22px; accent-color: var(--forest); }

.notification-list { display: grid; gap: 9px; }
.notification-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.notification-row.unread { border-inline-start: 3px solid var(--forest-2); background: #fbfdf8; }
.notification-icon { width: 37px; height: 37px; border-radius: 12px; background: #e5eee9; display: grid; place-items: center; }
.notification-row h3,.notification-row p { margin: 0; }
.notification-row h3 { font-size: 12px; }
.notification-row p,.notification-row small { color: var(--muted); font-size: 9px; }
.detail-hero h2 { font-family:'Playfair Display',serif; font-size: 34px; }
.detail-hero p { max-width: 760px; line-height: 1.8; color: var(--muted); }
.admin-table { display: grid; }
.admin-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 15px 0; border-top: 1px solid var(--line); }
.admin-row b,.admin-row small { display: block; }
.admin-row small,.admin-row > span { color: var(--muted); font-size: 9px; }
.empty,.empty-card { padding: 28px; text-align: center; color: var(--muted); font-size: 11px; }
.empty-card { background: rgba(255,253,248,.7); border: 1px dashed #cfc8bc; border-radius: 18px; }

/* Landing */
.landing {
  min-height: 100vh;
  color: #fffdf8;
  background:
    radial-gradient(circle at 82% 20%, rgba(217,239,157,.15), transparent 20rem),
    radial-gradient(circle at 10% 70%, rgba(167,217,199,.08), transparent 26rem),
    #102a24;
  overflow: hidden;
}
.landing header { height: 92px; max-width: 1240px; margin: auto; padding: 24px 28px; display: flex; justify-content: space-between; align-items: center; }
.landing main { max-width: 1240px; margin: auto; min-height: calc(100vh - 92px); display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 40px; padding: 30px 28px 90px; }
.hero-copy h1 { max-width: 720px; margin: 18px 0; font-family:'Playfair Display',serif; font-size: clamp(52px,6vw,82px); line-height: .98; letter-spacing: -.055em; }
.hero-copy h1 em { color: var(--lime); font-style: italic; }
.hero-copy p { max-width: 590px; color: #a8c0b7; font-size: 16px; line-height: 1.75; }
.hero-copy .button { margin-inline-end: 8px; background: var(--lime); color: var(--forest); box-shadow: none; }
.hero-copy .button.secondary { background: rgba(255,255,255,.07); color: #edf4ef; border: 1px solid rgba(255,255,255,.1); }
.hero-visual { height: 560px; position: relative; display: grid; place-items: center; }
.orb { width: 320px; height: 320px; border-radius: 50%; border: 1px solid rgba(217,239,157,.18); display: grid; place-content: center; text-align: center; box-shadow: 0 0 0 44px rgba(217,239,157,.035),0 0 0 45px rgba(217,239,157,.1); }
.orb b { font-family:'Playfair Display',serif; font-size: 72px; color: var(--lime); letter-spacing: -.06em; }
.orb span { color: #8cab9f; font-size: 11px; }
.float-card { position: absolute; min-width: 205px; padding: 17px 20px; background: #fffdf8; color: var(--ink); border: 1px solid #e4ded3; border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.18); }
.float-card small,.float-card b,.float-card span { display: block; }
.float-card small { color: #89948e; font-size: 9px; letter-spacing:.12em; }
.float-card b { margin: 7px 0 3px; }
.float-card span { color: var(--muted); font-size: 10px; }
.fc1 { top: 20%; left: 1%; transform: rotate(-4deg); }
.fc2 { right: 2%; bottom: 18%; transform: rotate(4deg); }

/* Auth */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(340px,.9fr) minmax(520px,1.1fr); background: var(--paper); }
.auth-art {
  min-height: 100vh;
  padding: 42px clamp(34px,5vw,72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fffdf8;
  background:
    radial-gradient(circle at 75% 14%, rgba(217,239,157,.16), transparent 18rem),
    linear-gradient(145deg,#14382f,#0f2822);
  position: sticky;
  top: 0;
  overflow: hidden;
}
.auth-art::after { content:''; position:absolute; width:370px; height:370px; border:1px solid rgba(217,239,157,.12); border-radius:50%; left:-170px; bottom:-140px; box-shadow:0 0 0 48px rgba(217,239,157,.025),0 0 0 96px rgba(217,239,157,.018); }
.auth-art > * { position:relative; z-index:2; }
.auth-art h1 { max-width: 570px; margin: 12px 0; font-family:'Playfair Display',serif; font-size: clamp(42px,5vw,72px); line-height: 1; letter-spacing: -.05em; }
.auth-art p { max-width: 520px; color: #acc6bc; line-height: 1.7; }
.auth-form { min-height: 100vh; padding: 54px clamp(24px,6vw,90px); display: grid; place-items: center; }
.auth-card { width: min(600px,100%); }
.auth-card h2 { margin: 0 0 7px; font-size: clamp(30px,3vw,42px); letter-spacing: -.045em; }
.auth-card > p { margin: 0 0 30px; color: var(--muted); }
.auth-card form { display: grid; gap: 16px; }
.auth-card label { display: grid; gap: 7px; color: #35423d; font-size: 12px; font-weight: 700; }
.auth-card input,.auth-card select,.auth-card textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid #d7d1c6;
  border-radius: 15px;
  outline: none;
  background: rgba(255,253,248,.84);
  color: var(--ink);
  transition: border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
.auth-card input[type=file] { padding: 11px 12px; }
.auth-card input:focus,.auth-card select:focus,.auth-card textarea:focus { border-color: #6a9888; background: #fffdf8; box-shadow: 0 0 0 4px rgba(106,152,136,.1); }
.auth-card .button { min-height: 54px; margin-top: 4px; border-radius: 16px; font-size: 15px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { min-height: 22px; color: var(--danger); font-size: 11px; line-height: 1.55; }
.switch-auth { text-align: center; color: var(--muted); font-size: 12px; }
.switch-auth a { color: var(--forest); font-weight: 800; }

/* States */
.loading { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.loading span { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #ddd7cc; border-top-color: var(--forest); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-page { min-height: 55vh; display: grid; place-content: center; justify-items: center; text-align: center; }
.state-page > b { font-family:'Playfair Display',serif; font-size: 62px; color: var(--forest); }
.state-page h2 { margin: 6px 0; }
.state-page p { max-width: 520px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: min(90vw,440px); padding: 12px 16px; border-radius: 14px; background: #172f28; color: #fff; box-shadow: var(--shadow); font-size: 11px; transform: translate(-50%,18px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translate(-50%,0); opacity: 1; }

/* RTL */
html[dir=rtl] body { font-family:'Noto Kufi Arabic','DM Sans',sans-serif; }
html[dir=rtl] .sidebar nav a.active { box-shadow: none; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 220px minmax(0,1fr); }
  .sidebar { padding-inline: 14px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .subject-grid,.room-grid,.opportunity-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw,310px);
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 24px 0 70px rgba(0,0,0,.2);
  }
  html[dir=rtl] .sidebar { left: auto; right: 0; transform: translateX(105%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; display: grid; place-items: center; background: var(--surface); }
  .topbar { min-height: 82px; padding: 15px 18px; gap: 12px; }
  .topbar > div:nth-child(2) { min-width: 0; flex: 1; }
  .topbar h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .eyebrow { display: none; }
  .top-actions .icon-button:first-child { display: none; }
  .content { padding: 22px 18px 92px; }
  .welcome { min-height: 230px; padding: 28px 24px; align-items: flex-end; }
  .welcome h2 { font-size: 34px; }
  .welcome p { font-size: 12px; max-width: 70%; }
  .streak { position: absolute; right: 22px; top: 22px; min-width: 78px; padding: 13px 14px; border-radius: 18px; }
  html[dir=rtl] .streak { right: auto; left: 22px; }
  .streak b { font-size: 28px; }
  .subject-grid,.room-grid,.opportunity-grid { grid-template-columns: 1fr 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-card { display: grid; grid-template-columns: 84px 1fr; text-align: start; align-items: center; }
  .profile-avatar { width: 76px; height: 76px; margin: 0; }
  .auth-page { display: block; }
  .auth-art { min-height: auto; height: 280px; padding: 30px 26px; position: relative; }
  .auth-art h1 { font-size: 42px; max-width: 620px; }
  .auth-art p { display: none; }
  .auth-form { min-height: auto; padding: 34px 22px 56px; place-items: start stretch; }
  .auth-card { margin: auto; }
  .landing main { grid-template-columns: 1fr; }
  .hero-visual { height: 420px; }
}

@media (max-width: 600px) {
  body { background: #f7f4ed; }
  .topbar { border-bottom-color: rgba(222,216,204,.72); }
  .top-actions { gap: 5px; }
  .icon-button { width: 39px; height: 39px; border-radius: 12px; }
  .content { padding: 16px 14px 84px; }
  .welcome { min-height: 245px; border-radius: 25px; padding: 26px 21px; }
  .welcome h2 { max-width: 78%; font-size: 33px; }
  .welcome p { max-width: 86%; line-height: 1.6; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 9px; margin: 10px 0; }
  .metric { min-height: 122px; padding: 16px; border-radius: 17px; }
  .metric::before { margin-bottom: 14px; }
  .metric strong { font-size: 24px; }
  .dashboard-grid { gap: 10px; }
  .panel { padding: 18px; border-radius: 19px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar > .button { align-self: flex-start; }
  .search { min-width: 0; width: 100%; }
  .subject-grid,.room-grid,.opportunity-grid { grid-template-columns: 1fr; gap: 10px; }
  .subject-card,.room-card,.opportunity-card { min-height: auto; border-radius: 19px; padding: 19px; }
  .schedule-row { grid-template-columns: 36px 1fr auto; padding: 15px; gap: 10px; }
  .post-card { padding: 18px; border-radius: 19px; }
  .category-tabs { overflow-x: auto; padding-bottom: 3px; }
  .category-tabs a { white-space: nowrap; }
  .course-row { align-items: flex-start; flex-direction: column; }
  .course-row > div { width: 100%; }
  .detail-list > div { grid-template-columns: 1fr; gap: 5px; }
  .notification-row { grid-template-columns: 38px 1fr; }
  .notification-row > small { grid-column: 2; }
  .admin-row { align-items: flex-start; flex-direction: column; }
  .auth-art { height: 225px; padding: 24px 22px; }
  .auth-art .brand { align-self: flex-start; }
  .auth-art h1 { font-size: 35px; margin-bottom: 0; }
  .auth-art .eyebrow { display: none; }
  .auth-form { padding: 28px 18px 44px; }
  .auth-card h2 { font-size: 31px; }
  .auth-card > p { margin-bottom: 24px; font-size: 12px; line-height: 1.65; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-card input,.auth-card select { min-height: 50px; border-radius: 14px; }
  .landing header { height: 74px; padding: 18px; }
  .landing main { min-height: calc(100vh - 74px); padding: 35px 20px 70px; align-content: start; }
  .hero-copy h1 { margin-top: 22px; font-size: 53px; }
  .hero-copy p { font-size: 14px; }
  .hero-copy .button { width: 100%; margin: 7px 0 0; }
  .hero-visual { height: 360px; }
  .orb { width: 220px; height: 220px; }
  .orb b { font-size: 52px; }
  .fc1 { left: 0; top: 8%; }
  .fc2 { right: 0; bottom: 7%; }
  .float-card { min-width: 165px; padding: 13px 15px; }
}
