/* ============================================================
   Applydright — app pages (login + dashboard)
   Uses the marketing site's design tokens from styles.css so the
   signed-in experience looks like the same product. No changes to
   the marketing design system itself.
   ============================================================ */

/* [hidden] must win over component display rules (.btn is inline-flex,
   .auth-divider is flex, etc.) */
[hidden] { display: none !important; }

/* ══════════════════════════════════════════════════════════
   AUTH (login.html)
   ══════════════════════════════════════════════════════════ */
.auth-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg-soft); }
.auth-bg::before {
  content: ''; position: absolute; inset: -20%;
  background:
    radial-gradient(38% 48% at 12% 8%, rgba(124,58,237,.16), transparent 62%),
    radial-gradient(42% 52% at 88% 6%, rgba(6,182,212,.13), transparent 62%),
    radial-gradient(45% 55% at 60% 96%, rgba(99,102,241,.14), transparent 62%);
}
.auth-back {
  position: fixed; top: 22px; left: 22px; z-index: 5;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .9rem; color: var(--slate-600);
  background: var(--white); border: 1px solid var(--border);
  padding: 9px 16px; border-radius: var(--r-pill); box-shadow: var(--shadow-xs);
  transition: var(--t) var(--ease);
}
.auth-back:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); color: var(--violet-700); }

.auth-wrap { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 92px 20px 48px; }
.auth-card {
  width: min(440px, 100%); background: var(--white);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.auth-head {
  padding: 32px 32px 24px; text-align: center;
  background: linear-gradient(180deg, #faf9ff, #fff);
  border-bottom: 1px solid var(--border);
}
.auth-logo { width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--grad-violet); color: #fff; box-shadow: var(--shadow-glow-soft); }
.app-bar .logo-mark, .auth-card .logo-mark { background: var(--grad-violet); color: #fff; }
.auth-head h1 { font-size: 1.5rem; }
.auth-sub { color: var(--text-muted); font-size: .93rem; margin-top: 7px; }
.auth-body { padding: 26px 32px 30px; }

.auth-tabs { display: flex; gap: 6px; padding: 5px; background: var(--slate-100); border-radius: var(--r-sm); margin-bottom: 20px; }
.auth-tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  padding: 9px 12px; border-radius: 9px;
  font: inherit; font-size: .88rem; font-weight: 700; color: var(--slate-500);
  transition: var(--t-fast) var(--ease);
}
.auth-tab.active { background: var(--white); color: var(--violet-700); box-shadow: var(--shadow-xs); }

.auth-note {
  font-size: .85rem; font-weight: 600; color: var(--amber-500);
  background: #fffbeb; border: 1px solid #fde68a;
  padding: 10px 12px; border-radius: var(--r-xs); margin-bottom: 16px;
}

.google-btn { gap: 10px; font-weight: 700; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--slate-400); font-size: .78rem; font-weight: 600; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: .82rem; font-weight: 700; color: var(--slate-600); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-xs);
  font: inherit; font-size: .95rem; color: var(--heading); background: var(--white);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--violet-400); box-shadow: 0 0 0 4px rgba(124,58,237,.12);
}
.field-hint { font-size: .78rem; color: var(--slate-400); margin-top: 5px; }

.auth-status { margin-top: 14px; min-height: 20px; text-align: center; font-size: .89rem; font-weight: 600; color: var(--text-muted); }
.auth-status.error { color: var(--rose-600); }
.auth-status.success { color: var(--emerald-600); }
.auth-foot { margin-top: 18px; font-size: .8rem; color: var(--slate-400); text-align: center; line-height: 1.6; }
.auth-alt { margin-top: 22px; font-size: .88rem; color: var(--text-muted); text-align: center; }
.auth-alt a { color: var(--violet-600); font-weight: 700; }
.auth-alt a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════
   DASHBOARD (dashboard.html)
   ══════════════════════════════════════════════════════════ */
body.app { background: var(--bg-soft); }

.app-bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.app-bar-inner {
  width: min(var(--maxw), calc(100% - 2 * var(--gutter)));
  margin-inline: auto; height: 68px;
  display: flex; align-items: center; gap: 16px;
}
.app-bar .brand { margin-right: auto; }

.app-user { display: flex; align-items: center; gap: 10px; }
.app-avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--grad-violet); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: .85rem;
  box-shadow: var(--shadow-glow-soft);
}
.app-user-meta { line-height: 1.3; }
.app-user-meta b { display: block; font-size: .85rem; color: var(--heading); font-weight: 700; }
.app-user-meta span { font-size: .74rem; color: var(--text-muted); }
.tier-pill {
  font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-pill);
}
.tier-pill.pro { background: var(--grad-violet); color: #fff; }
.tier-pill.free { background: var(--slate-100); color: var(--slate-600); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; flex: none; position: relative;
  display: grid; place-items: center; cursor: pointer;
  background: var(--white); border: 1px solid var(--border); color: var(--slate-600);
  transition: var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--violet-700); border-color: var(--violet-200); background: var(--violet-50); }
.icon-btn .dot-badge {
  position: absolute; top: 7px; right: 7px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-pill); background: var(--rose-500); color: #fff;
  font-size: .62rem; font-weight: 800; line-height: 16px; text-align: center;
  border: 2px solid var(--white);
}

.app-shell {
  width: min(var(--maxw), calc(100% - 2 * var(--gutter)));
  margin-inline: auto; padding: 28px 0 64px;
  display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 28px; align-items: start;
}

.app-shell > aside { position: sticky; top: 96px; }
.side-nav { display: grid; gap: 3px; }
.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border-radius: var(--r-xs);
  font-size: .9rem; font-weight: 600; color: var(--slate-600);
  cursor: pointer; border: 1px solid transparent;
  transition: var(--t-fast) var(--ease);
}
.side-link svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.side-link:hover { background: var(--white); color: var(--heading); }
.side-link.active { background: var(--white); color: var(--violet-700); border-color: var(--border); box-shadow: var(--shadow-xs); }
.side-link.active svg { opacity: 1; }
.side-count { margin-left: auto; font-size: .72rem; font-weight: 800; color: var(--slate-400); }
.side-upsell {
  margin-top: 18px; padding: 16px; border-radius: var(--r-md);
  background: linear-gradient(155deg, #f5f3ff, #eef2ff);
  border: 1px solid var(--violet-100);
}
.side-upsell h4 { font-size: .92rem; margin-bottom: 5px; }
.side-upsell p { font-size: .78rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }

.panel-view { display: none; }
.panel-view.active { display: block; animation: viewIn .3s var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head h1 { font-size: 1.5rem; letter-spacing: -.02em; }
.view-head p { font-size: .89rem; color: var(--text-muted); margin-top: 4px; }
.view-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 8px 14px; font-size: .82rem; border-radius: var(--r-xs); }

.surface {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 22px;
}
.surface + .surface { margin-top: 16px; }
.surface-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.surface-head h2 { font-size: 1.05rem; letter-spacing: -.015em; }
.surface-head a { font-size: .82rem; font-weight: 700; color: var(--violet-600); cursor: pointer; }
.surface-head a:hover { text-decoration: underline; }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 20px;
}
.kpi .kpi-label { font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--slate-400); }
.kpi .kpi-val { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; letter-spacing: -.03em; color: var(--heading); margin-top: 7px; line-height: 1; }
.kpi .kpi-sub { font-size: .78rem; color: var(--text-muted); margin-top: 6px; }
.kpi.accent .kpi-val { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Pipeline */
.pipeline { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.pipe-cell {
  text-align: center; padding: 13px 6px; border-radius: var(--r-xs);
  background: var(--slate-50); border: 1px solid var(--border); cursor: pointer;
  transition: var(--t-fast) var(--ease);
}
.pipe-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.pipe-cell.on { border-color: var(--violet-300); background: var(--violet-50); }
.pipe-cell .n { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--heading); }
.pipe-cell .l { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-500); margin-top: 3px; }

/* Rows (applications, documents, jobs, top 10) */
.row-list { display: grid; gap: 10px; }
.row-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--white); border: 1px solid var(--border);
  transition: var(--t-fast) var(--ease);
}
.row-item:hover { border-color: var(--violet-200); box-shadow: var(--shadow-sm); }
.row-main { min-width: 0; flex: 1; }
.row-title { font-weight: 700; font-size: .94rem; color: var(--heading); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title a:hover { color: var(--violet-700); text-decoration: underline; }
.row-sub { font-size: .8rem; color: var(--text-muted); margin-top: 3px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.row-side { display: flex; align-items: center; gap: 8px; flex: none; }
.row-avatar {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: .88rem;
  background: var(--grad-violet);
}
.score-chip {
  font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--slate-100); color: var(--slate-600); white-space: nowrap;
}
.score-chip.good { background: #ecfdf5; color: var(--emerald-600); }
.score-chip.warn { background: #fffbeb; color: #b45309; }
.score-chip.bad  { background: #fff1f2; color: var(--rose-600); }
.score-chip.info { background: var(--violet-50); color: var(--violet-700); }
.auto-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: var(--violet-50); color: var(--violet-700); border: 1px solid var(--violet-100);
}
.stage-select {
  font: inherit; font-size: .78rem; font-weight: 700; color: var(--slate-600);
  padding: 6px 10px; border-radius: var(--r-xs);
  border: 1px solid var(--border-strong); background: var(--white); cursor: pointer;
}
.stage-select:focus { outline: none; border-color: var(--violet-400); }
.link-btn { background: none; border: none; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700; color: var(--slate-400); padding: 6px; }
.link-btn:hover { color: var(--rose-600); }

/* Empty / loading states */
.state { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.state .state-ic { font-size: 1.9rem; margin-bottom: 10px; }
.state h3 { font-size: 1rem; margin-bottom: 6px; color: var(--heading); }
.state p { font-size: .88rem; max-width: 42ch; margin: 0 auto 16px; line-height: 1.6; }
.skeleton { display: grid; gap: 10px; }
.skeleton-row { height: 68px; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--slate-100) 25%, #fff 50%, var(--slate-100) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Notifications drawer */
.drawer-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(15,16,36,.32); opacity: 0; pointer-events: none; transition: opacity var(--t); }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 71;
  width: min(400px, 100%); background: var(--white);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transform: translateX(102%); transition: transform var(--t) var(--ease);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 1.05rem; }
.drawer-body { padding: 12px 14px 24px; overflow-y: auto; }
.notif {
  display: flex; gap: 12px; padding: 13px; border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.notif:hover { background: var(--slate-50); }
.notif + .notif { border-top: 1px solid var(--border); border-radius: 0; }
.notif-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: .9rem; }
.notif-body { min-width: 0; }
.notif-body b { display: block; font-size: .87rem; color: var(--heading); font-weight: 700; }
.notif-body p { font-size: .8rem; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.notif-body time { display: block; font-size: .72rem; color: var(--slate-400); margin-top: 4px; }

/* Profile view */
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.skill-chip { font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: var(--r-pill); background: var(--violet-50); color: var(--violet-700); border: 1px solid var(--violet-100); }
.meter { height: 8px; border-radius: 6px; background: var(--slate-100); overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; border-radius: 6px; background: var(--grad-violet); transition: width .9s var(--ease-out); }
.kv { display: grid; grid-template-columns: 132px 1fr; gap: 8px 16px; font-size: .89rem; }
.kv dt { color: var(--text-muted); font-weight: 600; }
.kv dd { color: var(--heading); font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 90;
  background: var(--ink-900); color: #fff; font-size: .87rem; font-weight: 600;
  padding: 12px 20px; border-radius: var(--r-pill); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity var(--t), transform var(--t) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Responsive */
@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; gap: 20px; }
  .app-shell > aside { position: static; }
  .side-nav {
    grid-auto-flow: column; grid-auto-columns: max-content;
    overflow-x: auto; padding-bottom: 6px; gap: 6px;
  }
  .side-link { white-space: nowrap; }
  .side-count, .side-upsell { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .app-user-meta { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .row-item { flex-wrap: wrap; }
  .row-side { width: 100%; justify-content: flex-start; }
  .auth-body, .auth-head { padding-inline: 22px; }
}
