:root {
  color-scheme: light;
  --ink: #172422;
  --muted: #76827f;
  --line: #e7ece8;
  --paper: #fff;
  --canvas: #f6f8f5;
  --green: #166c57;
  --green-dark: #0d4e40;
  --green-soft: #e4f2ec;
  --lime: #d1e45e;
  --shadow: 0 22px 65px rgba(19, 50, 41, .08);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.loading-screen { min-height: 100vh; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .92fr) 1.08fr; background: #fff; }
.login-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 42px clamp(36px, 7vw, 110px) 38px; color: #fff; overflow: hidden; background: radial-gradient(ellipse at 82% 7%, rgba(161, 202, 97, .18), transparent 30%), radial-gradient(ellipse at 4% 82%, rgba(98, 170, 131, .13), transparent 34%), #102b28; }
.login-aside::after { position: absolute; right: -140px; bottom: -240px; width: 560px; height: 560px; content: ""; border: 1px solid rgba(255,255,255,.10); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.02); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 16px Manrope, sans-serif; letter-spacing: -.045em; white-space: nowrap; }
.brand-light { color: #fff; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; color: #102b28; background: var(--lime); border-radius: 10px 10px 10px 3px; font: 800 14px Manrope, sans-serif; letter-spacing: -.08em; }
.brand-dot { color: #81bd90; }
.login-message { position: relative; z-index: 1; max-width: 560px; margin: auto 0; padding: 60px 0 90px; }
.eyebrow { margin: 0 0 12px; color: #8c9994; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.login-message .eyebrow { color: #b4d187; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, "DM Sans", sans-serif; letter-spacing: -.045em; }
.login-message h1 { margin: 0 0 22px; font-size: clamp(44px, 5.1vw, 70px); line-height: 1.04; font-weight: 600; }
.login-message h1 em { color: #cce679; font-style: normal; }
.login-message > p:last-child { max-width: 360px; color: #c2ceca; font-size: 16px; line-height: 1.75; }
.aside-foot { position: relative; z-index: 1; color: #8da09a; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 42px; }
.login-form { width: min(100%, 390px); }
.login-form .eyebrow { color: var(--green); }
.login-form h2 { margin-bottom: 9px; font-size: 34px; }
.muted { color: var(--muted); line-height: 1.65; }
.login-form > .muted { margin-bottom: 35px; font-size: 14px; }
label { display: grid; gap: 8px; color: #44514d; font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #dce4df; border-radius: 9px; padding: 13px 14px; outline: none; color: var(--ink); background: #fff; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: #62a68d; box-shadow: 0 0 0 3px rgba(48, 135, 105, .12); }
.login-form input { height: 48px; margin-bottom: 20px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; border-radius: 9px; padding: 11px 16px; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 5px 13px rgba(22,108,87,.13); }
.button-primary:hover { background: var(--green-dark); }
.button-wide { width: 100%; height: 50px; margin-top: 3px; }
.button-quiet { color: #66736f; background: transparent; border-color: transparent; }
.button-quiet:hover { background: #eff3f0; }
.login-note { margin: 24px 0 0; color: #98a29e; text-align: center; font-size: 11px; line-height: 1.6; }
.form-error { margin: 12px 0; color: #9d3131; font-size: 12px; line-height: 1.55; }

.workspace { min-height: 100vh; }
.topbar { position: sticky; z-index: 5; top: 0; display: flex; height: 72px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 clamp(24px, 4vw, 62px); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.brand-divider { width: 1px; height: 19px; margin-left: 5px; background: #dfe6e1; }
.brand-section { color: #7c8884; font: 500 12px "DM Sans", sans-serif; letter-spacing: 0; }
.account-menu { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid #cfe1d6; border-radius: 50%; color: #245d4d; background: #e6f0e8; font-size: 12px; font-weight: 700; }
.account-label { display: grid; min-width: 94px; gap: 2px; }
.account-label strong { font-size: 11px; }
.account-label small { color: #8a9691; font-size: 10px; }
.account-menu .button { margin-left: 12px; }
.workspace-grid { display: grid; min-height: calc(100vh - 72px); grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: relative; display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 32px 17px 23px; background: #fbfcfa; }
.side-title-row { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 14px; }
.side-title-row .eyebrow { margin: 0; font-size: 9px; }
.count-badge { display: inline-grid; min-width: 23px; height: 23px; place-items: center; padding: 0 6px; border: 1px solid #e6ece7; border-radius: 99px; color: #76837d; background: #fff; font-size: 10px; }
.side-link { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; border-radius: 7px; padding: 10px; color: #68746f; background: transparent; text-align: left; cursor: pointer; font-size: 11px; }
.side-link:hover, .side-link-active { color: #235d4c; background: #eaf3ed; }
.side-icon { width: 15px; color: #7d9b8c; font-size: 15px; text-align: center; }
.client-list { display: grid; gap: 2px; }
.client-dot { width: 15px; color: #82a988; text-align: center; }
.side-rule { height: 1px; margin: 17px 9px; background: #e9eeea; }
.admin-nav .eyebrow { display: block; padding: 0 10px 7px; font-size: 9px; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin: auto 5px 0; padding: 14px 7px 0; color: #89958f; font-size: 10px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #7eb896; box-shadow: 0 0 0 3px #eaf4eb; }
.main-panel { width: min(100%, 1160px); margin: 0 auto; padding: 47px clamp(28px, 5vw, 78px) 90px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.page-heading .eyebrow, .detail-heading .eyebrow { margin-bottom: 9px; color: #5a9278; }
.page-heading h1, .detail-heading h1, .users-heading h1 { margin: 0 0 8px; font-size: clamp(30px, 3vw, 39px); line-height: 1.2; }
.page-heading .muted { margin: 0; font-size: 13px; }
.button-plus { margin-right: -6px; font-size: 17px; font-weight: 400; }
.search-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 35px 0 20px; }
.search-box { display: flex; width: min(100%, 540px); height: 45px; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: #fff; }
.search-box:focus-within { border-color: #80b29c; box-shadow: 0 0 0 3px rgba(48,135,105,.08); }
.search-box input { height: 100%; border: 0; padding: 0; box-shadow: none; font-size: 12px; }
.search-icon { color: #7f968b; font-size: 21px; line-height: 1; }
kbd { border: 1px solid #e5e9e6; border-radius: 4px; padding: 2px 5px; color: #9ba49f; background: #fafbfa; font-size: 9px; white-space: nowrap; }
.results-label { color: #89958f; font-size: 10px; white-space: nowrap; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.project-card { display: flex; min-height: 204px; flex-direction: column; align-items: stretch; border: 1px solid #e8ede9; border-radius: 12px; padding: 20px 21px 16px; background: #fff; box-shadow: 0 2px 8px rgba(29,65,52,.025); text-align: left; cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s; }
.project-card:hover { transform: translateY(-2px); border-color: #c4d9ca; box-shadow: 0 12px 27px rgba(25,74,53,.08); }
.card-topline, .card-footer { display: flex; align-items: center; justify-content: space-between; }
.client-pill { border-radius: 99px; padding: 5px 9px; color: #487760; background: #eef6ef; font-size: 9px; font-weight: 700; }
.card-arrow { color: #9ba8a0; font-size: 16px; }
.project-card h2 { margin: 19px 0 7px; font-size: 18px; font-weight: 700; }
.card-summary { display: -webkit-box; overflow: hidden; margin: 0 0 15px; color: #7b8782; font-size: 11px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-footer { justify-content: flex-start; gap: 9px; margin-top: auto; color: #91a099; font-size: 9px; }
.card-footer .status-dot { width: 6px; height: 6px; }
.empty-state { max-width: 430px; margin: 76px auto; text-align: center; }
.empty-mark { display: grid; width: 56px; height: 56px; margin: 0 auto 19px; place-items: center; border: 1px solid #dce9dc; border-radius: 17px; color: #39846a; background: #e9f3ea; font-size: 25px; }
.empty-state h2 { margin-bottom: 8px; font-size: 22px; }
.empty-state p { margin-bottom: 20px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.back-link { display: inline-flex; align-items: center; gap: 9px; border: 0; margin: 0 0 26px; padding: 5px 0; color: #678076; background: transparent; cursor: pointer; font-size: 11px; }
.detail-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.detail-heading .muted { margin: 0; font-size: 11px; }
.context-card { border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; background: #fff; }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; color: #334740; font-size: 12px; font-weight: 700; }
.section-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; color: #39836b; background: #e8f3eb; font-size: 17px; }
.markdown-body { white-space: pre-wrap; color: #65726d; font-size: 12px; line-height: 1.8; }
.updates-heading { display: flex; align-items: center; justify-content: space-between; margin: 37px 0 14px; }
.updates-heading .eyebrow { margin-bottom: 6px; color: #7c9988; }
.updates-heading h2 { margin: 0; font-size: 22px; }
.no-updates { border: 1px dashed #dbe4dd; border-radius: 10px; padding: 22px; color: #85918c; background: #fbfcfa; font-size: 12px; line-height: 1.6; }
.update-card { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 10px; padding: 18px 21px; background: #fff; }
.update-meta { margin-bottom: 9px; color: #82938a; font-size: 10px; }
.update-card h3 { margin: 0 0 8px; font-size: 15px; }
.update-content { margin: 0; color: #65726d; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.users-heading { margin-top: 8px; margin-bottom: 28px; }
.users-list { display: grid; gap: 9px; }
.user-row { display: flex; min-height: 70px; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 15px; background: #fff; }
.user-avatar { width: 37px; height: 37px; }
.user-info { display: grid; flex: 1; gap: 4px; }
.user-info strong { font-size: 11px; }
.user-info .muted { font-size: 10px; }
.role-badge { border-radius: 99px; padding: 5px 9px; color: #597769; background: #eef4ef; font-size: 9px; white-space: nowrap; }
.role-admin { color: #654f92; background: #f2eef9; }
.role-viewer { color: #707c83; background: #f0f2f3; }
.remove-user { margin-left: 5px; font-size: 10px; }

.dialog { width: min(560px, calc(100% - 32px)); max-height: min(90vh, 800px); overflow: auto; border: 1px solid #e2e9e4; border-radius: 15px; padding: 0; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(15, 34, 29, .46); backdrop-filter: blur(2px); }
.dialog-form { display: grid; gap: 16px; padding: 27px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; }
.dialog-head .eyebrow { margin-bottom: 7px; color: #6b987f; }
.dialog-head h2 { margin: 0; font-size: 24px; }
.dialog-form > .muted { margin: -7px 0 3px; font-size: 11px; }
.dialog-close { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; color: #78847e; background: #f1f4f1; cursor: pointer; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-slugs { margin-top: -5px; }
.dialog-form label { gap: 7px; font-size: 11px; }
.dialog-form label small { color: #929c97; font-size: 9px; font-weight: 400; }
.dialog-form input, .dialog-form textarea, .dialog-form select { font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.toast { position: fixed; right: 25px; bottom: 24px; z-index: 10; border: 1px solid #d5e5d8; border-radius: 9px; padding: 13px 16px; color: #285a45; background: #f2faf1; box-shadow: 0 8px 24px rgba(25,64,45,.13); font-size: 12px; }

@media (max-width: 900px) {
  .login-view { grid-template-columns: minmax(280px, .8fr) 1.2fr; }
  .login-aside { padding: 32px; }
  .workspace-grid { grid-template-columns: 200px minmax(0, 1fr); }
  .main-panel { padding: 38px 30px 70px; }
}
@media (max-width: 680px) {
  .login-view { display: block; background: var(--canvas); }
  .login-aside { min-height: 245px; padding: 23px 25px; }
  .login-message { padding: 31px 0 20px; }
  .login-message h1 { font-size: 37px; }
  .login-message > p:last-child { margin: 0; font-size: 12px; }
  .login-message .eyebrow { margin-bottom: 9px; font-size: 8px; }
  .aside-foot { display: none; }
  .login-panel { min-height: calc(100vh - 245px); padding: 35px 24px; }
  .topbar { height: 62px; padding: 0 15px; }
  .brand { gap: 7px; font-size: 13px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-divider, .brand-section { display: none; }
  .account-menu { gap: 7px; }
  .account-label { min-width: 0; max-width: 80px; }
  .account-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-menu .button { margin-left: 1px; padding: 8px; font-size: 10px; }
  .workspace-grid { display: block; min-height: calc(100vh - 62px); }
  .sidebar { display: block; border-right: 0; border-bottom: 1px solid var(--line); padding: 11px 16px; }
  .side-title-row, .side-rule, .client-list, .sidebar-foot { display: none !important; }
  .admin-nav:not([hidden]) { display: flex !important; align-items: center; gap: 5px; margin-top: 4px; }
  .admin-nav .eyebrow { display: none; }
  #all-projects { width: auto; padding: 9px 11px; }
  .main-panel { padding: 32px 18px 65px; }
  .page-heading { align-items: start; }
  .page-heading h1, .detail-heading h1 { font-size: 28px; }
  .page-heading .muted { font-size: 11px; }
  .page-heading > .button { flex: 0 0 auto; padding: 10px; font-size: 10px; }
  .page-heading > .button .button-plus { display: none; }
  .search-row { display: block; margin: 25px 0 15px; }
  .search-box { width: 100%; }
  .results-label { display: block; margin: 8px 2px 0; text-align: right; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { min-height: 177px; }
  .detail-heading { align-items: start; flex-direction: column; }
  .context-card { padding: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .users-heading { align-items: start; flex-direction: column; }
  .users-heading > .button { width: 100%; }
  .user-row { gap: 9px; padding: 10px; }
  .role-badge { padding: 4px 6px; font-size: 8px; }
  .remove-user { padding: 7px 5px; }
  .dialog-form { gap: 13px; padding: 20px; }
}
