/* ============================================================
   BizDocs AI — Layout
   ============================================================ */

/* ---- App shell ---- */
#app {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--clr-sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5);
  border-bottom: 1px solid rgba(255,255,255,.08);
  min-height: var(--header-h);
}

.sidebar__brand-name {
  display: flex;
  flex-direction: column;
}

.sidebar__brand-name span:first-child {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.3px;
}

.sidebar__brand-name span:last-child {
  font-size: 10px;
  color: var(--clr-sidebar-text);
  opacity: .7;
}

.sidebar__logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sidebar__nav {
  flex: 1;
  padding: var(--sp-4) var(--sp-3);
}

.sidebar__section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--clr-sidebar-text);
  opacity: .45;
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--clr-sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}

.sidebar__link svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
  transition: opacity var(--transition);
}

.sidebar__link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}
.sidebar__link:hover svg { opacity: 1; }

.sidebar__link.active {
  background: var(--clr-sidebar-active);
  color: #fff;
}
.sidebar__link.active svg { opacity: 1; }

.sidebar__footer {
  padding: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  color: var(--clr-sidebar-text);
  opacity: .5;
  text-align: center;
}

/* ---- Main area ---- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */
.header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header__left {
  display: flex;
  flex-direction: column;
}

.header__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--clr-text);
}

.header__subtitle {
  font-size: 12px;
  color: var(--clr-text-muted);
}

.header__right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.header__search {
  position: relative;
}

.header__search input {
  width: 220px;
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-8);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-full);
  font-size: 13px;
  background: var(--clr-bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header__search input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.header__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--clr-text-muted);
  pointer-events: none;
}

.header__avatar {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.header__avatar-menu {
  position: absolute;
  top: calc(var(--header-h) - 8px);
  right: var(--sp-6);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: var(--sp-2);
  z-index: 200;
  display: none;
}

.header__avatar-menu.open { display: block; }

.header__avatar-menu button {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: none;
  background: none;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--clr-text);
  text-align: left;
}
.header__avatar-menu button:hover { background: var(--clr-bg); }
.header__avatar-menu button.danger { color: var(--clr-danger); }

/* ---- Page content ---- */
.page {
  flex: 1;
  padding: var(--sp-6);
  max-width: 1400px;
  width: 100%;
}

.page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.page__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--clr-text);
}

.page__subtitle {
  font-size: 13px;
  color: var(--clr-text-muted);
  margin-top: 2px;
}

/* ---- Auth layout (login screen) ---- */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-primary);
  padding: var(--sp-4);
}

.auth__card {
  background: var(--clr-surface);
  border-radius: var(--r-xl);
  padding: var(--sp-10) var(--sp-8);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.auth__brand-text { display: flex; flex-direction: column; }
.auth__brand-text h1 {
  font-size: 22px;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth__brand-text p {
  font-size: 11px;
  color: var(--clr-text-muted);
}

.auth__heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--sp-2);
}

.auth__sub {
  font-size: 13px;
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-6);
}

.auth__demo-hint {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: 12px;
  color: var(--clr-primary);
  margin-bottom: var(--sp-5);
  line-height: 1.6;
}

/* Responsive: hide sidebar on narrow screens */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .header__search { display: none; }
}

/* ============================================================
   Auth split layout
   ============================================================ */

html, body, #app {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.auth-split {
  width: 100vw;
  min-height: 100vh;
  display: flex;
}

/* ---- Left panel ---- */
.auth-split__left {
  flex: 0 0 45%;
  background: linear-gradient(160deg, #1a3fb5 0%, #2563EB 40%, #7C3AED 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 52px;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.auth-split__left::before {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  top: -120px; right: -120px;
  pointer-events: none;
}
.auth-split__left::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  bottom: -80px; left: -80px;
  pointer-events: none;
}

.auth-split__left-inner {
  position: relative;
  z-index: 1;
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.auth-split__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-split__brand-name {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.4px;
}
.auth-split__brand-tag {
  font-size: 11.5px;
  color: rgba(255,255,255,.65);
  margin-top: 2px;
}

.auth-split__headline {
  font-size: 36px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.auth-split__headline-accent {
  color: rgba(255,255,255,.75);
}

.auth-split__features {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-split__feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.auth-split__feature-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}
.auth-split__feature-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
}
.auth-split__feature-sub {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  line-height: 1.45;
}

/* ---- Right panel ---- */
.auth-split__right {
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 52px;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.auth-split__dots {
  position: absolute;
  top: 20px;
  right: 20px;
  opacity: .4;
  pointer-events: none;
}

.auth-split__form-wrap {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.auth-split__form-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--clr-text);
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}

.auth-split__form-sub {
  font-size: 14px;
  color: var(--clr-text-muted);
  margin-bottom: 24px;
}

.auth-split__form-wrap .auth__demo-hint {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: #1D4ED8;
  margin-bottom: 24px;
}

.auth-split__form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  margin-top: -4px;
}
.auth-split__remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--clr-text-muted);
  cursor: pointer;
  user-select: none;
}
.auth-split__remember input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--clr-primary);
  cursor: pointer;
}
.auth-split__forgot {
  font-size: 13px;
  color: var(--clr-primary);
  font-weight: 500;
  cursor: pointer;
}
.auth-split__forgot:hover { text-decoration: underline; }

.auth-split__submit {
  width: 100%;
  height: 48px;
  font-size: 15px;
  letter-spacing: 0.2px;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 20px;
}

.auth-split__disclaimer {
  text-align: center;
  font-size: 11.5px;
  color: var(--clr-text-muted);
}

/* ---- Input with icons ---- */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-muted);
  pointer-events: none;
}
.input-icon--left  { left: 12px; }
.input-icon--right { right: 12px; pointer-events: all; }
.input-icon--btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}
.input-icon--btn:hover { color: var(--clr-primary); }
.input-with-icon-left  { padding-left: 38px !important; }
.input-with-icon-right { padding-right: 38px !important; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .auth-split { flex-direction: column; }
  .auth-split__left {
    flex: none;
    min-height: auto;
    padding: 40px 32px;
  }
  .auth-split__headline { font-size: 26px; }
  .auth-split__right {
    flex: none;
    min-height: auto;
    padding: 40px 32px;
  }
}
@media (max-width: 480px) {
  .auth-split__left,
  .auth-split__right { padding: 32px 20px; }
  .auth-split__headline   { font-size: 22px; }
  .auth-split__form-title { font-size: 22px; }
}