@charset "UTF-8";

:root {
  --brand: #176c5b;
  --brand-deep: #0a3f36;
  --brand-soft: #e8f3ee;
  --ink: #142925;
  --text: #40514e;
  --muted: #778783;
  --line: #e5ebe8;
  --bg: #f5f7f6;
  --white: #fff;
  --gold: #d8ad61;
  --radius: 18px;
  --sidebar: 272px;
  --shadow: 0 14px 38px rgba(21, 55, 48, .07);
  --shadow-hover: 0 20px 48px rgba(21, 55, 48, .12);
}

html { background: var(--bg); }
body { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); letter-spacing: -.005em; }
h1, h2, h3 { color: var(--ink); }
h1 { font-size: clamp(2rem, 3vw, 3rem); font-weight: 720; letter-spacing: -.045em; }
h2 { font-weight: 700; letter-spacing: -.025em; }
a, button, input, select, textarea { transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
input, select, textarea { border: 1px solid #dbe4e0; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(20, 41, 37, .02); }
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--brand) 65%, white); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); outline: 0; }

.button { min-height: 44px; border-radius: 12px; border-color: var(--brand); background: var(--brand); box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 19%, transparent); font-weight: 700; }
.button:hover { background: var(--brand-deep); transform: translateY(-1px); box-shadow: 0 11px 24px color-mix(in srgb, var(--brand) 24%, transparent); }
.button.secondary { border-color: #dce5e1; background: rgba(255, 255, 255, .88); box-shadow: 0 4px 12px rgba(18, 50, 43, .04); }
.button.secondary:hover { color: var(--brand-deep); border-color: #bdcec7; background: white; }
.small-button { min-height: 36px; border-radius: 10px; }
.eyebrow { color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.panel { border-color: rgba(215, 226, 221, .9); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { padding: 24px 26px 20px; }
.panel-heading h2 { font-size: 18px; }
.panel-heading p { font-size: 13px; }
.notice, .alert { border-radius: 13px; box-shadow: 0 5px 18px rgba(18, 50, 43, .04); }
.notice.success { background: #eef8f2; color: #216346; border-color: #cde9d9; }
.pill { border-radius: 999px; font-size: 11px; font-weight: 750; padding: 6px 10px; }
.pad { padding: 26px; }

.workspace-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; }
.workspace-brand img { width: 42px; height: 42px; padding: 3px; border-radius: 12px; object-fit: contain; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .16); }
.workspace-brand span { display: flex; flex-direction: column; min-width: 0; }
.workspace-brand b { color: inherit; font-size: 20px; line-height: 1.05; letter-spacing: -.04em; }
.workspace-brand small { margin-top: 5px; font-size: 8px; font-weight: 750; letter-spacing: .13em; opacity: .62; }

.sidebar { background: linear-gradient(175deg, #113f36 0%, #0b302a 68%, #082620 100%); padding: 27px 18px 22px; box-shadow: 10px 0 35px rgba(13, 50, 42, .08); }
.sidebar>.workspace-brand { margin: 0 10px 26px; color: white; }
.school-switch { padding: 13px 14px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; background: rgba(255, 255, 255, .055); }
.school-switch:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.school-switch .school-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; background: linear-gradient(145deg, #eef3d7, #bcd3a3); color: #1b5344; font: 800 18px Georgia, serif; }
.school-switch>.icon { width: 16px; transform: rotate(90deg); opacity: .6; }
.school-switch small { color: #92b2a5; }
.nav-label { margin: 25px 13px 10px; color: #70988a; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.nav-item { min-height: 43px; margin: 3px 0; padding: 10px 13px; border-radius: 11px; color: #aec5bd; font-size: 12px; font-weight: 580; }
.nav-item:hover { color: white; background: rgba(255, 255, 255, .07); transform: translateX(2px); }
.nav-item.active { color: #0c4539; background: linear-gradient(135deg, #f0f5df, #d9e9c8); box-shadow: 0 8px 20px rgba(0, 0, 0, .14); }
.nav-item .icon { width: 18px; height: 18px; }
.sidebar-bottom { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 8px; margin: 28px 10px 0; padding: 20px 4px 0; color: #a6bdb5; }
.sidebar-bottom small { grid-column: 2; margin: 4px 0 0; }

.app-body { background: radial-gradient(circle at 76% -10%, rgba(210, 228, 218, .55), transparent 28%), var(--bg); }
.topbar { height: 78px; padding: 0 34px; border-color: rgba(219, 228, 224, .85); background: rgba(255, 255, 255, .83); box-shadow: 0 5px 22px rgba(20, 55, 47, .035); }
.breadcrumb { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.breadcrumb b { color: var(--ink); font-weight: 700; letter-spacing: 0; text-transform: none; }
.icon-button { border-color: #e1e8e5; border-radius: 11px; background: white; box-shadow: 0 4px 12px rgba(15, 55, 46, .04); }
.icon-button:hover { color: var(--brand); border-color: #bfd1ca; transform: translateY(-1px); }
.language-toggle { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 3px; border: 1px solid #dce5e1; border-radius: 11px; background: white; color: var(--muted); box-shadow: 0 4px 12px rgba(15, 55, 46, .04); }
.language-toggle span, .language-toggle b { display: grid; place-items: center; min-width: 31px; height: 28px; border-radius: 8px; font-size: 10px; }
.language-toggle span { color: white; background: var(--brand); }
.language-toggle b { color: #6c7d79; }
html[data-language="ms"] .language-toggle span { color: #6c7d79; background: transparent; }
html[data-language="ms"] .language-toggle b { color: white; background: var(--brand); }
.account { padding: 5px 8px 5px 5px; border-radius: 12px; }
.account:hover { background: #f3f7f5; }
.account b { font-size: 12px; }
.account small { font-size: 10px; }
.account .avatar { width: 37px; height: 37px; border-radius: 11px; }
.logout { display: inline-flex; align-items: center; gap: 7px; color: #687b76; font-size: 11px; }
.logout .icon { width: 16px; }
.main-content { max-width: 1540px; padding: 34px 40px 0; }
.page-heading { align-items: flex-end; margin-bottom: 28px; }
.page-heading>div:first-child { max-width: 760px; }
.page-heading h1 { font-size: clamp(29px, 3vw, 42px); margin-bottom: 9px; }
.page-heading p { color: #71817d; font-size: 14px; line-height: 1.65; }
.page-heading>.button { min-height: 43px; font-size: 12px; }
.app-footer { margin-top: 55px; padding: 24px 0 30px; font-size: 10px; letter-spacing: .04em; }

table { font-size: 13px; }
th { padding: 13px 22px; color: #71817c; background: #f8faf9; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
td { padding: 18px 22px; }
tbody tr:hover { background: #f7faf8; }
.strong-link { color: var(--ink); font-size: 12px; }
.filters { padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .88); box-shadow: 0 9px 24px rgba(21, 55, 48, .04); }
.search-field input { min-height: 44px; }
.pagination { font-size: 11px; }
.class-card, .product-card { border-radius: var(--radius); box-shadow: var(--shadow); }
.class-card:hover, .product-card:hover { border-color: #b9cec5; box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stat-card { border-radius: 16px; box-shadow: 0 9px 26px rgba(21, 55, 48, .055); }
.welcome-banner { border-radius: 22px; background: linear-gradient(130deg, #0d4e41 0%, #1c6b58 70%, #40816d 100%); box-shadow: 0 22px 48px rgba(11, 66, 54, .18); }

/* Intake */
.intake-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.intake-stage { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; min-height: 78px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, .88); color: var(--text); box-shadow: 0 6px 18px rgba(21, 55, 48, .035); }
.intake-stage>span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; }
.intake-stage b, .intake-stage small { display: block; }
.intake-stage b { color: var(--ink); font-size: 12px; }
.intake-stage small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.3; }
.intake-stage strong { font-size: 21px; color: #91a09c; }
.intake-stage:hover, .intake-stage.active { border-color: #adc9bd; background: white; box-shadow: var(--shadow); transform: translateY(-2px); }
.intake-stage.active>span { color: white; background: var(--brand); }
.intake-stage.active strong { color: var(--brand); }
.intake-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 22px; }
.intake-records .filters { border-width: 1px 0; border-radius: 0; box-shadow: none; }
.placement-panel { position: sticky; top: 98px; padding: 26px; overflow: visible; }
.placement-panel>p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.placement-panel .form-field { margin-top: 17px; }
.placement-panel .form-field input, .placement-panel .form-field select { width: 100%; }
.placement-panel fieldset { margin: 22px 0; padding: 0; border: 0; }
.placement-panel legend { margin-bottom: 11px; color: var(--ink); font-size: 11px; font-weight: 800; }
.placement-panel .check-row { padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }
.placement-panel .check-row span { flex: 1; }
.placement-panel .check-row b, .placement-panel .check-row small { display: block; }
.placement-panel .check-row small { color: var(--muted); font-size: 9px; }
.placement-empty { padding: 24px 14px; border: 1px dashed #cedbd6; border-radius: 13px; background: #f9fbfa; text-align: center; }
.placement-empty .icon { color: #8ca199; }
.placement-empty p { margin: 10px 0 6px; color: var(--muted); font-size: 11px; }
.placement-empty a { font-size: 11px; font-weight: 700; }

/* Catalogue */
.catalogue-filter { margin-bottom: 16px; }
.catalogue-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; padding: 0 4px; color: var(--muted); font-size: 11px; }
.catalogue-summary b { margin-right: 5px; color: var(--ink); font-size: 18px; }
.product-group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.product-group-card { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 330px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.product-group-card:hover { border-color: #bfd1ca; box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.product-group-media { position: relative; min-height: 100%; overflow: hidden; background: linear-gradient(150deg, #e7efe9, #f5f2e5); }
.product-group-media>img { width: 100%; height: 100%; object-fit: cover; }
.product-placeholder { display: grid; place-items: center; align-content: center; width: 100%; height: 100%; min-height: 300px; color: #789283; }
.product-placeholder .icon { width: 60px; height: 60px; }
.product-placeholder span { margin-top: 12px; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.stock-total { position: absolute; left: 14px; bottom: 14px; padding: 7px 10px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--brand-deep); box-shadow: 0 5px 15px rgba(0, 0, 0, .1); font-size: 10px; font-weight: 800; backdrop-filter: blur(8px); }
.stock-total.out-of-stock { color: #9b4a40; }
.product-group-body { min-width: 0; padding: 24px; }
.product-group-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.product-group-heading h2 { margin: 0; font-size: 21px; }
.product-group-heading .eyebrow { margin-bottom: 8px; font-size: 8px; }
.product-price { color: var(--brand-deep); font-size: 18px; white-space: nowrap; }
.product-group-body>.muted { margin: 11px 0 17px; font-size: 11px; }
.variant-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.variant-row { display: grid; grid-template-columns: 55px 48px minmax(45px, 1fr) auto auto; align-items: center; gap: 8px; min-height: 42px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 10px; }
.variant-row:last-child { border-bottom: 0; }
.variant-row:hover { background: #f7faf8; }
.variant-gender { color: #60746e; font-weight: 700; }
.variant-stock { color: #47705e; font-size: 9px; white-space: nowrap; }
.variant-stock.low { color: #a06932; }
.variant-edit { font-weight: 750; }
.catalogue-empty { grid-column: 1 / -1; }

.catalogue-order { display: flex; flex-direction: column; gap: 22px; }
.order-student { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 22px 25px; }
.order-student>div, .order-section-heading, .order-submit>div { display: flex; align-items: center; gap: 14px; }
.order-student h2, .order-section-heading h2 { margin: 0 0 3px; }
.order-student p, .order-section-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.order-student select { width: min(390px, 48%); }
.step-number { display: grid; place-items: center; flex: none; width: 35px; height: 35px; border-radius: 11px; background: var(--brand); color: white; font-size: 12px; font-weight: 800; }
.order-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
.order-group>header { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 13px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.order-group>header img, .order-group-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 13px; object-fit: cover; background: var(--brand-soft); color: var(--brand); }
.order-group>header h2 { margin: 0 0 4px; font-size: 17px; }
.order-group>header p { margin: 0; color: var(--muted); font-size: 10px; }
.order-group>header>strong { color: var(--brand-deep); font-size: 15px; }
.order-variants { padding: 8px; }
.order-variant { display: grid; grid-template-columns: minmax(100px, 1fr) auto 62px; align-items: center; gap: 12px; margin: 0; padding: 9px 10px; border-radius: 10px; }
.order-variant:hover { background: #f5f9f7; }
.order-variant>span:first-of-type b, .order-variant>span:first-of-type small { display: block; }
.order-variant>span:first-of-type small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.order-variant input[type="number"] { width: 62px; padding: 8px; text-align: center; }
.order-variant.unavailable { opacity: .48; }
.order-submit { display: flex; justify-content: space-between; align-items: center; gap: 25px; position: sticky; bottom: 16px; z-index: 5; padding: 17px 20px; border: 1px solid #d8e5df; border-radius: 17px; background: rgba(255, 255, 255, .93); box-shadow: 0 15px 40px rgba(21, 55, 48, .13); backdrop-filter: blur(12px); }
.order-submit b, .order-submit small { display: block; }
.order-submit small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.product-editor { max-width: 980px; }
.form-span { grid-column: 1 / -1; }

/* Conversations */
.conversation-list { overflow: hidden; }
.room-row { position: relative; padding: 21px 24px; gap: 16px; }
.room-row:hover { background: linear-gradient(90deg, #f7faf8, white); }
.room-avatar { display: grid; place-items: center; flex: none; width: 45px; height: 45px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }
.room-title { display: flex; align-items: center; gap: 10px; }
.room-title h3 { margin: 0; font-size: 14px; }
.room-row p { margin: 5px 0; font-size: 12px; }
.room-open { color: #8ba098; }
.room-open .icon { width: 18px; }
.chat-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.chat-heading h1 { margin: 0 0 6px; font-size: 32px; }
.chat-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.chat-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.chat-messages { min-height: 400px; max-height: 62vh; overflow-y: auto; padding: 30px; background: radial-gradient(circle at 10% 20%, rgba(225, 239, 231, .6), transparent 26%), #f8faf9; }
.message-bubble { max-width: 72%; padding: 13px 16px; border: 1px solid #e0e8e4; border-radius: 4px 16px 16px 16px; background: white; box-shadow: 0 7px 18px rgba(21, 55, 48, .05); }
.message-bubble.mine { color: #f1faf6; border: 0; border-radius: 16px 16px 4px 16px; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 18%, transparent); }
.message-bubble.mine b, .message-bubble.mine small { color: #cfe3da; }
.message-bubble b { color: var(--brand-deep); font-size: 10px; }
.message-bubble p { margin: 6px 0; font-size: 13px; line-height: 1.55; }
.message-bubble small { color: #879690; font-size: 9px; }
.attachment { margin-top: 8px; border: 1px solid rgba(110, 142, 130, .18); border-radius: 9px; }
.chat-composer { padding: 17px; border-top: 1px solid var(--line); background: white; }
.chat-tools { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.chat-tools form { margin: 0; }
.chat-composer>form { padding: 5px; border: 1px solid #dbe5e1; border-radius: 15px; background: #fbfcfc; }
.chat-composer textarea { width: 100%; resize: vertical; border: 0; background: transparent; box-shadow: none; }
.composer-actions { display: flex; align-items: center; gap: 12px; padding: 7px; border-top: 1px solid #e7ecea; }
.composer-actions>small { flex: 1; color: var(--muted); font-size: 9px; }
.attachment-button { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 7px 9px; border-radius: 9px; color: var(--brand); cursor: pointer; }
.attachment-button:hover { background: var(--brand-soft); }
.attachment-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.attachment-button .icon { width: 16px; }

/* Public pages */
.public-body { min-height: 100vh; background: radial-gradient(circle at 10% 0, #e7f1eb, transparent 30%), radial-gradient(circle at 90% 55%, #f2ead8, transparent 28%), #f8faf8; }
.public-header { max-width: 1280px; padding: 24px 42px; }
.public-brand { color: var(--ink); }
.public-actions { display: flex; align-items: center; gap: 20px; }
.public-header-note { font-size: 11px; }
.portal-intro h1 { font-size: clamp(42px, 6vw, 68px); }
.portal-intro h1 em { color: #69895f; }
.institution-card { border-radius: 23px; box-shadow: var(--shadow); }
.institution-card[href]:hover { box-shadow: var(--shadow-hover); }
.login-grid { max-width: 1120px; border-radius: 25px; box-shadow: 0 28px 70px rgba(21, 55, 48, .11); }
.login-story { background: linear-gradient(145deg, #0d493e, #196451); }
.login-story h1 { font-size: 41px; }
.login-story h1 em { color: #d9e5b8; }
.login-form { padding: 58px 52px; }
.login-form h2 { font-size: 34px; }

.theme-dark { --ink: #e7efec; --text: #cad7d2; --muted: #91a39d; --line: #2c403a; --bg: #15201d; --white: #1d2b27; }
.theme-dark .topbar, .theme-dark .panel, .theme-dark .class-card, .theme-dark .product-group-card, .theme-dark .chat-panel, .theme-dark .filters, .theme-dark .order-submit { background: rgba(29, 43, 39, .94); }
.theme-dark input, .theme-dark select, .theme-dark textarea { color: var(--text); border-color: #344a43; background: #182722; }
.theme-dark th, .theme-dark tbody tr:hover, .theme-dark .order-variant:hover, .theme-dark .placement-empty { background: #21322d; }

@media (max-width: 1250px) {
  :root { --sidebar: 238px; }
  .main-content { padding-inline: 26px; }
  .product-group-grid { grid-template-columns: 1fr; }
  .product-group-card { grid-template-columns: 250px 1fr; }
  .intake-stages { grid-template-columns: repeat(3, 1fr); }
  .intake-layout { grid-template-columns: minmax(0, 1fr) 310px; }
}

@media (max-width: 940px) {
  .intake-layout { grid-template-columns: 1fr; }
  .placement-panel { position: static; }
  .order-groups { grid-template-columns: 1fr; }
  .topbar { padding-inline: 20px; }
  .logout span, .breadcrumb>span, .breadcrumb>b { display: none; }
}

@media (max-width: 760px) {
  .sidebar { top: 66px; }
  .topbar { height: 66px; }
  .main-content { padding: 23px 16px 0; }
  .language-toggle { height: 34px; }
  .topbar-right .account>span:last-child { display: none; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 30px; }
  .intake-stages { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .intake-stage { flex: 0 0 210px; }
  .product-group-card { grid-template-columns: 1fr; }
  .product-group-media { min-height: 220px; }
  .product-placeholder { min-height: 220px; }
  .product-group-heading { flex-direction: column; }
  .variant-row { grid-template-columns: 50px 42px 1fr auto; }
  .variant-edit { grid-column: 1 / -1; padding-top: 4px; }
  .catalogue-summary { align-items: flex-start; flex-direction: column; }
  .order-student { align-items: flex-start; flex-direction: column; }
  .order-student select { width: 100%; }
  .order-submit { align-items: stretch; flex-direction: column; bottom: 8px; }
  .order-submit .button { width: 100%; }
  .message-bubble { max-width: 90%; }
  .chat-messages { min-height: 330px; padding: 18px; }
  .composer-actions { flex-wrap: wrap; }
  .composer-actions>small { order: 3; flex-basis: 100%; }
  .public-header { padding: 18px; }
  .public-header-note { display: none; }
  .public-brand img { width: 38px; height: 38px; }
  .login-form { padding: 34px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
