/* ==========================================================================
   Oakframe Media OS — refinement layer
   Loaded after portal.css. Styles the split-screen auth, boot loader,
   floating-label fields, collapsible sidebar, ⌘K palette, empty states,
   and skeletons — all via the same CSS custom properties portal.css
   defines per-theme, so this file works unchanged in light or dark.
   ========================================================================== */

/* Auth ------------------------------------------------------------------- */
.auth-body { overflow: hidden; }
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; position: relative; }
.auth-theme-btn { position: absolute; top: 18px; right: 18px; z-index: 5; background: var(--surface); border: 1px solid var(--hairline-strong); }
/* Always black, in either theme — this is the one place the app shows its
   actual logo full-size, so it gets the logo's own black canvas rather than
   adapting to the light/dark toggle like everything else. */
.auth-aside {
  position: relative; padding: 54px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: #0a0a0a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  color: #f2f2f0;
}
.auth-brand { display: flex; align-items: center; gap: 13px; font-family: var(--font-display); font-size: 17px; z-index: 1; color: #f2f2f0; }
.auth-brand .brand-mark { background: none; color: #f2f2f0; width: auto; height: auto; }
.auth-brand .brand-mark .icon { width: 34px; height: 34px; }
.auth-brand span { text-transform: uppercase; letter-spacing: 2.5px; font-weight: 700; font-size: 14px; }
.auth-pitch { z-index: 1; }
.auth-pitch h1 { font-size: 46px; line-height: 1.06; letter-spacing: -1.4px; font-weight: 800; color: #f9f8f4; }
.auth-pitch p { color: rgba(242, 242, 240, 0.62); font-size: 16px; max-width: 30ch; margin-top: 20px; line-height: 1.6; }
.auth-foot { color: rgba(242, 242, 240, 0.4); font-size: 12px; letter-spacing: .3px; z-index: 1; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--surface); }
.auth-card { width: 100%; max-width: 384px; }
.auth-head h2 { font-size: 27px; letter-spacing: -0.5px; }
.auth-head p { margin-top: 8px; font-size: 14px; }
.auth-form { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-error { font-size: 12.5px; color: var(--bad); min-height: 0; }
.auth-error.info { color: var(--good); }
.auth-switch { margin-top: 22px; font-size: 13px; color: var(--muted); text-align: center; }

/* Floating-label fields --------------------------------------------------- */
.field { position: relative; }
.field input {
  width: 100%; background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-sm);
  color: var(--ink); padding: 21px 15px 8px; font-size: 14.5px; outline: none; font-family: var(--font-body);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--ring); }
.field label {
  position: absolute; left: 15px; top: 15px; font-size: 14px; color: var(--muted);
  pointer-events: none; transition: all .15s ease;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label {
  top: 7px; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--gold-deep); font-weight: 600;
}

/* Boot / loading ---------------------------------------------------------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--muted); background: var(--bg); }
.boot .brand-mark.xl { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.boot-bar { width: 180px; height: 3px; border-radius: 3px; background: var(--track); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 40%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.boot p { font-size: 13.5px; }
.boot-error { color: var(--bad); max-width: 40ch; text-align: center; }
.boot code { background: var(--code-bg); padding: 2px 6px; border-radius: 5px; font-size: 12px; }

/* Skeletons --------------------------------------------------------------- */
.skeleton { position: relative; overflow: hidden; background: var(--skeleton-base); border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-row { height: 46px; margin: 8px 0; }
.sk-kpi { height: 92px; }

/* Sidebar — collapsible rail ---------------------------------------------- */
.sidebar { transition: width .2s cubic-bezier(.2,.7,.3,1); }
.shell.rail .sidebar { width: 70px; }
.shell.rail .brand-text, .shell.rail .nav-label, .shell.rail .nav-item span:not(.nav-icon):not(.nav-count), .shell.rail .me-info, .shell.rail .nav-count { opacity: 0; pointer-events: none; }
.shell.rail .nav-item { justify-content: center; }
.shell.rail .nav-section .nav-label { height: 8px; }
.brand { position: relative; }
.sb-collapse { position: absolute; right: 12px; top: 24px; width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--hairline-strong); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: all .15s ease; }
.sb-collapse:hover { color: var(--ink); background: var(--hover); }
.shell.rail .sb-collapse { right: 50%; transform: translateX(50%); top: 68px; }
.nav-label { transition: opacity .15s ease; white-space: nowrap; overflow: hidden; }

/* ⌘K palette -------------------------------------------------------------- */
.global-search input { padding-right: 46px; cursor: pointer; }
.gs-kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); border: 1px solid var(--hairline-strong); border-radius: 6px; padding: 2px 7px; pointer-events: none; background: var(--surface); }
.cmdk-overlay { position: fixed; inset: 0; z-index: 150; background: var(--scrim); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 20px 20px; opacity: 0; transition: opacity .14s ease; }
.cmdk-overlay.open { opacity: 1; }
.cmdk { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; transform: translateY(-8px) scale(.99); transition: transform .16s cubic-bezier(.2,.7,.3,1); }
.cmdk-overlay.open .cmdk { transform: none; }
.cmdk-input-row { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
.cmdk-input-row svg { color: var(--muted); flex-shrink: 0; }
.cmdk-input-row input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-size: 17px; font-family: var(--font-body); }
.cmdk-hint { font-size: 11px; color: var(--muted); border: 1px solid var(--hairline-strong); border-radius: 6px; padding: 2px 7px; }
.cmdk-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cmdk-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--muted); padding: 12px 12px 6px; font-weight: 600; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); }
.cmdk-item .list-icon { width: 30px; height: 30px; }
.cmdk-item.active, .cmdk-item:hover { background: var(--gold-tint); color: var(--ink); }
.cmdk-item .cmdk-sub { color: var(--muted); font-size: 12px; }
.cmdk-empty { padding: 34px; text-align: center; color: var(--muted); }

.inline-note { margin: 14px 0 2px; padding: 11px 14px; border-radius: var(--r-sm); background: var(--gold-tint); border: 1px solid var(--gold-tint-2); color: var(--gold-deep); font-size: 12.5px; }

/* Empty states ------------------------------------------------------------ */
.empty-block { padding: 56px 20px; }
.empty-illus { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--hairline); color: var(--gold-deep); font-size: 30px; }
.empty-block p { font-size: 14px; max-width: 42ch; margin: 0 auto; }
.empty-cta { margin-top: 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.kpi-value { font-size: 27px; }

/* Onboarding checklist ------------------------------------------------------ */
.onboard-progress { display: flex; align-items: center; gap: 10px; padding: 2px 14px 12px; }
.onboard-item { cursor: pointer; }
.onboard-item input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--gold); cursor: pointer; }

/* Kanban card assignee stack ------------------------------------------------ */
.kc-avatars { display: flex; margin-left: auto; }
.kc-avatars .avatar { margin-left: -6px; border: 2px solid var(--surface); }
.kc-avatars .avatar:first-child { margin-left: 0; }
.avatar-more { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: -6px; border-radius: 50%; background: var(--hairline); color: var(--muted); font-size: 9px; font-weight: 600; border: 2px solid var(--surface); }

/* Multi-select checkbox list (e.g. task assignees) -------------------------- */
.checkbox-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 4px 12px; background: var(--surface); }
.checkbox-list .checkbox-row { display: flex; align-items: center; gap: 9px; padding: 8px 2px; font-size: 13.5px; cursor: pointer; border-bottom: 1px solid var(--hairline); }
.checkbox-list .checkbox-row:last-child { border-bottom: none; }
.checkbox-list .checkbox-row input { accent-color: var(--gold); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .content { padding: 20px 16px 56px; }
}
