:root {
  --ink: #272425;
  --ink-soft: #655f60;
  --paper: #f7f7f7;
  --white: #ffffff;
  --line: #e0e5ea;
  --brand: #8b3639;
  --brand-dark: #66282a;
  --brand-deep: #4f2022;
  --brand-soft: #f3e8e8;
  --green: #4f8d56;
  --green-soft: #e5f1df;
  --shadow: 0 20px 60px rgba(102, 40, 42, 0.14);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input { font: inherit; }
button { color: inherit; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(420px, .9fr); }
.brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 100vh; padding: 42px clamp(40px, 6vw, 92px); background: var(--brand); color: white; }
.brand-panel::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 76% 26%, rgba(229,241,223,.18), transparent 24%), linear-gradient(140deg, transparent 56%, rgba(255,255,255,.045)); }
.brand { position: relative; display: inline-flex; align-items: center; gap: 12px; color: inherit; font-family: Manrope, sans-serif; font-size: 18px; text-decoration: none; }
.brand strong { color: #e5f1df; }
.brand-mark { position: relative; display: block; width: 48px; height: 42px; overflow: hidden; border-radius: 8px; background: white; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.brand-mark img { display: block; width: 210px; max-width: none; height: 42px; object-fit: fill; object-position: left center; }
.brand-copy { position: relative; z-index: 1; max-width: 620px; margin-top: auto; margin-bottom: auto; }
.eyebrow { display: block; margin-bottom: 12px; color: var(--green); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.brand-panel .eyebrow { color: #e5f1df; }
.brand-copy h1 { margin: 0; max-width: 660px; font-family: Manrope, sans-serif; font-size: clamp(2.8rem, 5vw, 5.4rem); line-height: .98; letter-spacing: -.055em; }
.brand-copy p { max-width: 520px; margin: 26px 0 0; color: #ccd3e4; font-size: 1.07rem; line-height: 1.7; }
.company-note { position: relative; margin: 0; color: #929db9; font-size: .84rem; }

.signal-card { position: absolute; right: -90px; bottom: 5%; width: 320px; height: 320px; opacity: .72; }
.orbit { position: absolute; inset: 30px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.orbit-two { inset: 78px; border-color: rgba(229,241,223,.38); }
.signal-core { position: absolute; inset: 116px; display: grid; place-items: center; border-radius: 28px; background: white; color: var(--brand); transform: rotate(-8deg); }
.ladder-glyph { position: relative; display: block; width: 34px; height: 48px; }
.ladder-glyph b { position: absolute; top: 0; bottom: 0; width: 4px; border-radius: 4px; background: var(--brand); transform-origin: bottom; }
.ladder-glyph b:first-child { left: 4px; transform: rotate(11deg); }.ladder-glyph b:nth-child(2) { right: 4px; transform: rotate(-11deg); }
.ladder-glyph i { position: absolute; left: 7px; right: 7px; height: 3px; border-radius: 3px; background: var(--brand); }
.ladder-glyph i:nth-of-type(1) { top: 9px; }.ladder-glyph i:nth-of-type(2) { top: 19px; }.ladder-glyph i:nth-of-type(3) { top: 29px; }.ladder-glyph i:nth-of-type(4) { top: 39px; }
.signal-dot { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #e5f1df; box-shadow: 0 0 24px rgba(229,241,223,.65); }
.dot-one { left: 28px; top: 143px; }.dot-two { right: 56px; top: 43px; background: #dbaeb0; }.dot-three { right: 36px; bottom: 62px; background: #8fbd87; }

.auth-panel { display: grid; place-items: center; min-height: 100vh; padding: 36px; background: #fbfcff; }
.auth-card { width: min(100%, 440px); }
.mobile-brand { display: none; }
.auth-card h2 { margin: 0; font-family: Manrope, sans-serif; font-size: 2.2rem; letter-spacing: -.04em; }
.auth-intro { margin: 10px 0 28px; color: var(--ink-soft); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 25px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #f1f2f4; }
.tab { min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); font-weight: 600; cursor: pointer; }
.tab.is-active { background: white; color: var(--ink); box-shadow: 0 3px 12px rgba(20,31,75,.08); }
.field { display: grid; gap: 8px; margin-bottom: 17px; }
.field label { font-size: .9rem; font-weight: 700; }
.field input, .search-box input { min-height: 50px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: white; color: var(--ink); padding: 0 15px; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(139,54,57,.1); }
.field small { color: var(--ink-soft); }
.primary-button, .secondary-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border: 0; border-radius: 11px; cursor: pointer; font-weight: 700; }
.primary-button { background: var(--brand); color: white; box-shadow: 0 10px 26px rgba(102,40,42,.24); }
.primary-button:hover { background: var(--brand-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .65; cursor: wait; transform: none; }
.form-message { min-height: 0; margin: 0 0 14px; border-radius: 9px; color: #9f2f24; font-size: .9rem; line-height: 1.4; }
.form-message.success { color: #177060; }
.google-auth { margin-top: 22px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; color: var(--ink-soft); font-size: .78rem; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#google-signin { display: flex; justify-content: center; min-height: 44px; }
.allowed-domains { display: flex; align-items: flex-start; gap: 10px; margin-top: 25px; padding-top: 21px; border-top: 1px solid var(--line); color: var(--ink-soft); }
.allowed-domains p { margin: 0; font-size: .79rem; line-height: 1.6; }
.allowed-domains strong { color: var(--ink); font-weight: 600; }
.shield { display: grid; place-items: center; flex: 0 0 auto; width: 23px; height: 23px; border-radius: 8px 8px 10px 10px; background: var(--green-soft); color: var(--green); font-size: .78rem; font-weight: 800; }

.portal { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 30px 22px; background: var(--brand-dark); color: white; }
.portal-brand { margin: 0 8px 46px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: #b6bfd5; text-align: left; cursor: pointer; }
.nav-item span { width: 19px; text-align: center; font-size: 1.1rem; }
.nav-item:hover, .nav-item.is-active { background: rgba(255,255,255,.09); color: white; }
.sidebar-spacer { flex: 1; }
.workspace { min-width: 0; padding: 32px clamp(26px, 5vw, 72px); }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 27px; border-bottom: 1px solid var(--line); }
.workspace-header h1 { margin: 0; font-family: Manrope, sans-serif; font-size: clamp(1.65rem, 3vw, 2.15rem); letter-spacing: -.04em; }
.workspace-header .eyebrow { margin-bottom: 6px; }
.user-chip { display: flex; align-items: center; gap: 11px; }
.user-chip > span:last-child { display: grid; gap: 2px; }
.user-chip strong { font-size: .9rem; }
.user-chip small { color: var(--ink-soft); font-size: .74rem; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); font-size: .78rem; font-weight: 800; }
.menu-button { display: none; border: 0; background: transparent; font-size: 1.4rem; }
.workspace-lead { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin: 52px 0 25px; }
.workspace-lead h2 { margin: 0 0 7px; font-family: Manrope, sans-serif; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.045em; }
.workspace-lead p { margin: 0; color: var(--ink-soft); }
.search-box { position: relative; display: flex; align-items: center; min-width: min(330px, 100%); }
.search-box > span:first-child { position: absolute; left: 15px; z-index: 1; color: var(--ink-soft); font-size: 1.25rem; }
.search-box input { width: 100%; padding-left: 43px; }
.department-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.department-card { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 15px; min-height: 154px; padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); text-align: left; cursor: pointer; box-shadow: 0 7px 22px rgba(20,31,75,.035); transition: transform .2s, box-shadow .2s, border-color .2s; }
.department-card:hover { transform: translateY(-4px); border-color: #bcc4d8; box-shadow: var(--shadow); }
.department-card > span:nth-child(2) { align-self: end; display: grid; gap: 6px; grid-column: 1 / 3; }
.department-card strong { font: 700 1.04rem Manrope, sans-serif; }
.department-card small { color: var(--ink-soft); font-size: .78rem; line-height: 1.4; }
.department-card i { position: absolute; top: 25px; right: 23px; color: #8c97b3; font-style: normal; font-size: 1.15rem; }
.department-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 14px; font-size: 1.2rem; font-weight: 800; }
.coral, .blue, .violet { background: var(--brand-soft); color: var(--brand); }
.gold, .mint, .green { background: var(--green-soft); color: var(--green); }
.sky, .navy { background: #e0e5ea; color: #4b5563; }
.workspace footer { margin-top: 42px; color: #8b95ad; font-size: .75rem; }
.empty-search { padding: 48px; border: 1px dashed #c5ccdc; border-radius: 18px; color: var(--ink-soft); text-align: center; }

dialog { width: min(92vw, 480px); padding: 38px; border: 0; border-radius: 22px; color: var(--ink); box-shadow: 0 26px 80px rgba(14,23,59,.3); }
dialog::backdrop { background: rgba(10,17,46,.55); backdrop-filter: blur(4px); }
dialog h2 { margin: 18px 0 8px; font-family: Manrope, sans-serif; font-size: 1.7rem; }
dialog p { margin: 0 0 25px; color: var(--ink-soft); line-height: 1.6; }
.dialog-close { position: absolute; top: 15px; right: 17px; width: 35px; height: 35px; border: 0; border-radius: 50%; background: #f0f2f7; cursor: pointer; font-size: 1.25rem; }
.secondary-button { background: #eef0f6; color: var(--ink); }

@media (max-width: 1100px) {
  .department-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-card { opacity: .35; }
}
@media (max-width: 800px) {
  .auth-shell { display: block; }
  .brand-panel { display: none; }
  .auth-panel { padding: 28px 22px; }
  .mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; font-family: Manrope, sans-serif; }
  .mobile-brand strong { color: var(--brand); }
  .portal { display: block; }
  .sidebar { position: fixed; z-index: 5; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.is-open { transform: translateX(0); box-shadow: 20px 0 70px rgba(10,17,46,.3); }
  .workspace { padding: 24px 20px; }
  .menu-button { display: block; }
  .workspace-header { justify-content: flex-start; }
  .user-chip { margin-left: auto; }
  .user-chip > span:last-child { display: none; }
}
@media (max-width: 580px) {
  .workspace-lead { align-items: stretch; flex-direction: column; margin-top: 36px; }
  .department-grid { grid-template-columns: 1fr; }
  .department-card { min-height: 128px; }
  dialog { padding: 30px; }
}
