:root {
  color-scheme: light;
  --ink: #20302b;
  --muted: #68746f;
  --canvas: #f6f8f5;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --line: #dfe7e1;
  --brand: #2f6b5f;
  --brand-deep: #214e45;
  --brand-soft: #dcece7;
  --orange: #e97828;
  --orange-soft: #fff0df;
  --red: #b33e3e;
  --shadow: 0 12px 32px rgba(36, 67, 57, .08);
  --radius: 20px;
  --sidebar: 268px;
  font-family: Inter, ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 85% 0%, #e9f2ed 0, transparent 28rem), var(--canvas); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); padding: 26px 18px 20px; background: rgba(255,255,255,.94); border-right: 1px solid var(--line); backdrop-filter: blur(16px); display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 2px 8px 26px; text-decoration: none; }
.brand-mark { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 850; font-size: 16px; letter-spacing: -.4px; box-shadow: 0 8px 18px rgba(47,107,95,.22); }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.primary-nav { display: grid; gap: 5px; overflow-y: auto; }
.nav-label { margin: 20px 12px 6px; color: #85918c; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; font-size: 10px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 13px; padding: 11px 13px; color: #4b5b55; background: transparent; text-decoration: none; font-weight: 650; cursor: pointer; text-align: left; width: 100%; }
.nav-link span:first-child { width: 21px; text-align: center; font-size: 18px; }
.nav-link:hover { background: var(--surface-soft); }
.nav-link.active { color: var(--brand-deep); background: var(--brand-soft); }
.nav-link.danger { color: var(--red); }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.main-content { min-height: 100vh; margin-left: var(--sidebar); padding: 34px clamp(24px,4vw,58px) 64px; }
.page { width: min(1120px, 100%); margin: 0 auto; animation: enter .22s ease-out; }
@keyframes enter { from { opacity: .2; transform: translateY(5px) } }
.page-loading { min-height: 80vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; margin: 0 0 7px; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.035em; line-height: 1.05; }
h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 16px; }
.subtitle { color: var(--muted); margin: 9px 0 0; max-width: 620px; line-height: 1.5; }
.button { min-height: 44px; border: 0; border-radius: 13px; padding: 10px 17px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; color: #fff; background: var(--brand); font-weight: 750; cursor: pointer; text-decoration: none; box-shadow: 0 6px 15px rgba(47,107,95,.16); }
.button:hover { background: var(--brand-deep); }
.button.secondary { color: var(--brand-deep); background: var(--brand-soft); box-shadow: none; }
.button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); box-shadow: none; }
.button.danger { background: var(--red); }
.button.small { min-height: 34px; padding: 6px 11px; border-radius: 10px; font-size: 13px; }
.icon-button { position: relative; border: 1px solid var(--line); border-radius: 12px; width: 42px; height: 42px; display: grid; place-items: center; background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; border-radius: 10px; padding: 0 5px; display: grid; place-items: center; color: white; background: var(--orange); font-size: 10px; font-weight: 800; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 26px; }
.stat { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.78); }
.stat strong { display: block; margin-top: 5px; font-size: 27px; }
.stat span { color: var(--muted); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,.8fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.9); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { padding: 19px 21px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 20px; }
.task-card { --subject: var(--brand); position: relative; padding: 18px 18px 17px 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); overflow: hidden; }
.task-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--subject); }
.task-card.urgent { border-color: #f4c397; background: linear-gradient(135deg,var(--orange-soft),#fff 65%); }
.task-card.urgent::before { background: var(--orange); }
.task-card.completed { opacity: .62; }
.task-card.completed h3 { text-decoration: line-through; }
.task-top, .task-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subject-chip { border-radius: 999px; padding: 5px 9px; background: color-mix(in srgb,var(--subject) 14%,white); color: color-mix(in srgb,var(--subject) 80%,black); font-size: 11px; font-weight: 800; }
.due { font-size: 12px; color: var(--muted); font-weight: 700; }
.task-card h3 { margin-top: 12px; font-size: 17px; }
.task-card p { color: #56645f; line-height: 1.5; margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-foot { margin-top: 14px; color: var(--muted); font-size: 11px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; cursor: pointer; }
.check input { width: 19px; height: 19px; accent-color: var(--brand); }
.list { display: grid; gap: 10px; }
.list-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border: 0; }
.list-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-soft); }
.list-main { min-width: 0; flex: 1; }
.list-main p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 11px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters > * { min-width: 145px; }
.field { display: grid; gap: 7px; }
.field label, .field > span { font-size: 12px; color: #53615c; font-weight: 750; }
input, textarea, select { width: 100%; border: 1px solid #cfd9d2; border-radius: 12px; background: #fff; color: var(--ink); padding: 11px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 104px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.field.full, .form-actions { grid-column: 1/-1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 7px; }
.file-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.file-link { padding: 7px 9px; border-radius: 9px; background: var(--surface-soft); font-size: 12px; text-decoration: none; }
.chat-layout { display: grid; grid-template-rows: minmax(360px,calc(100vh - 300px)) auto; }
.messages { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.message { align-self: flex-start; max-width: min(76%,620px); }
.message.mine { align-self: flex-end; }
.bubble { border-radius: 8px 17px 17px 17px; background: var(--surface-soft); padding: 10px 13px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.mine .bubble { color: white; background: var(--brand); border-radius: 17px 8px 17px 17px; }
.message.system { align-self: center; max-width: 90%; text-align: center; color: var(--muted); font-size: 12px; }
.message-meta { margin: 0 5px 4px; color: var(--muted); font-size: 10px; }
.mine .message-meta { text-align: right; }
.chat-form { display: flex; gap: 9px; padding: 14px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; }
.notification.unread { border-left: 4px solid var(--orange); padding-left: 12px; }
.notification a { text-decoration: none; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border: 0; }
.toggle { width: 44px; height: 25px; flex: 0 0 auto; accent-color: var(--brand); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; text-align: left; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.status { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; background: var(--brand-soft); color: var(--brand-deep); }
.status.off { background: #f1dddd; color: var(--red); }
.tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 5px; margin-bottom: 18px; }
.tab { white-space: nowrap; border: 1px solid var(--line); border-radius: 12px; background: white; padding: 9px 13px; cursor: pointer; font-weight: 700; color: var(--muted); }
.tab.active { color: white; background: var(--brand); border-color: var(--brand); }
.modal { width: min(620px,calc(100% - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 30px 90px rgba(20,40,34,.24); }
.modal::backdrop { background: rgba(25,41,36,.46); backdrop-filter: blur(3px); }
.modal-inner { padding: 22px; overflow-y: auto; max-height: calc(100vh - 40px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(380px,calc(100% - 40px)); }
.toast { padding: 13px 15px; border-radius: 13px; color: white; background: var(--brand-deep); box-shadow: var(--shadow); animation: enter .2s; }
.toast.error { background: var(--red); }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(380px,.9fr); background: var(--canvas); }
.login-intro { position: relative; overflow: hidden; padding: clamp(40px,7vw,100px); display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: linear-gradient(145deg,#234f46,#37786a); }
.login-intro::after { content:""; position:absolute; width:420px; height:420px; border:80px solid rgba(255,255,255,.07); border-radius:50%; right:-180px; bottom:-140px; }
.login-brand { display: flex; gap: 14px; align-items: center; font-size: 20px; font-weight: 800; }
.login-brand .brand-mark { background: #fff; color: var(--brand-deep); }
.login-copy { position: relative; z-index: 1; max-width: 620px; }
.login-copy h1 { font-size: clamp(42px,6vw,76px); }
.login-copy p { color: #deebe7; font-size: 18px; line-height: 1.6; }
.login-form-wrap { padding: clamp(24px,7vw,90px); display: grid; align-content: center; }
.login-card { max-width: 430px; width: 100%; margin: auto; }
.login-card h2 { font-size: 30px; margin-bottom: 8px; }
.login-card > p { color: var(--muted); margin: 0 0 27px; }
.login-card form { display: grid; gap: 15px; }
.login-card .button { margin-top: 4px; }
.public-link { text-align: center; margin-top: 20px; color: var(--brand); font-weight: 700; }
.mobile-header { display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(20,40,34,.15); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { position: sticky; top: 0; z-index: 15; height: 70px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
  .brand.compact { padding: 0; gap: 9px; }
  .brand.compact .brand-mark { width: 42px; height: 42px; border-radius: 13px; font-size: 13px; }
  .header-actions { display: flex; gap: 8px; }
  .main-content { margin-left: 0; padding: 25px 16px 90px; }
  .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .login-page { grid-template-columns: 1fr; }
  .login-intro { min-height: 300px; padding: 34px 24px; }
  .login-copy h1 { font-size: 42px; }
  .login-copy p { font-size: 15px; }
  .login-form-wrap { padding: 42px 22px; }
}
@media (max-width: 560px) {
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-header .button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters > * { min-width: 0; }
  .task-top { align-items: flex-start; }
  .task-foot { align-items: flex-end; }
  .data-table { display: block; overflow-x: auto; }
  .message { max-width: 88%; }
  .panel-head, .panel-body { padding-left: 15px; padding-right: 15px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; } }
