/* Smart Label Costing — web. Mobile first; Bootstrap 5 underneath. */
:root {
  --lc-primary: #4f46e5;
  --lc-primary-dark: #4338ca;
  --lc-sky: #0ea5e9;
  --lc-ink: #1e293b;
  --lc-muted: #64748b;
  --lc-bg: #f6f7fb;
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: #1e293b;
}

html, body { min-height: 100%; }
body { background: var(--lc-bg); -webkit-tap-highlight-color: transparent; }

.btn-primary { --bs-btn-bg: var(--lc-primary); --bs-btn-border-color: var(--lc-primary); --bs-btn-hover-bg: var(--lc-primary-dark); --bs-btn-hover-border-color: var(--lc-primary-dark); --bs-btn-active-bg: var(--lc-primary-dark); --bs-btn-disabled-bg: var(--lc-primary); }
.form-control:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .18); }
/* 16 px inputs: iPhone does not zoom into the field */
.form-control, .form-select { font-size: 16px; }

/* ── LOGIN ─────────────────────────────────────────────── */
.page-login { background: #fff; }
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.login-brand {
  position: relative; overflow: hidden; color: var(--lc-ink);
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  padding: 28px 24px 22px;
}
.login-brand::before, .login-brand::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-brand::before { width: 260px; height: 260px; left: -70px; top: -60px; background: rgba(14, 165, 233, .14); }
.login-brand::after  { width: 300px; height: 300px; right: -120px; bottom: -170px; background: rgba(99, 102, 241, .10); }
.brand-inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand-logo {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none;
  color: #fff; font-size: 24px; font-weight: 600;
  background: linear-gradient(135deg, var(--lc-sky), var(--lc-primary)); box-shadow: 0 8px 20px rgba(79, 70, 229, .3);
}
.login-brand h1 { font-size: 1.45rem; font-weight: 650; margin: 0; }
.brand-sub {
  margin: 0; width: 100%; font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  background: linear-gradient(90deg, var(--lc-sky), var(--lc-primary)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-points { list-style: none; padding: 0; margin: 28px 0 0; width: 100%; }
.brand-points li { position: relative; padding-left: 26px; margin-bottom: 12px; color: #475569; }
.brand-points li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--lc-primary); font-weight: 700; }

.login-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 26px 18px 18px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 1.6rem; font-weight: 650; margin-bottom: .25rem; }
.login-card .form-label { font-weight: 600; font-size: .9rem; color: #334155; }
.pass-toggle { min-width: 52px; --bs-btn-border-color: var(--bs-border-color); --bs-btn-color: #64748b; --bs-btn-hover-bg: #f1f5f9; --bs-btn-hover-color: #334155; --bs-btn-hover-border-color: var(--bs-border-color); --bs-btn-active-bg: #e2e8f0; --bs-btn-active-color: #334155; }
.caps-warn { color: #b45309; }
.btn-signin { font-weight: 600; letter-spacing: .02em; padding-top: .7rem; padding-bottom: .7rem; }
.login-foot { margin-top: auto; padding-top: 24px; }

@media (min-width: 992px) {
  .login-wrap { flex-direction: row; }
  .login-brand { flex: 0 0 44%; max-width: 560px; display: flex; align-items: center; padding: 48px; }
  .brand-inner { display: block; }
  .brand-logo { width: 64px; height: 64px; font-size: 30px; border-radius: 18px; margin-bottom: 22px; }
  .login-brand h1 { font-size: 2.1rem; }
  .brand-sub { margin-top: 6px; font-size: .8rem; }
  .login-panel { justify-content: center; padding: 40px; }
  .login-card { margin-top: auto; }
}

/* ── SIGNED-IN PAGES ───────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 1020; background: #fff; border-bottom: 1px solid #e5e7eb;
  padding: 8px 0; padding-top: max(8px, env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--lc-ink); font-weight: 650; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--lc-sky), var(--lc-primary)); }
.fy-chip { font-size: .75rem; font-weight: 600; color: var(--lc-primary); background: #eef2ff; border-radius: 999px; padding: 3px 10px; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 1px solid #e5e7eb; border-radius: 999px; padding: 4px 12px 4px 4px; background: #fff; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: var(--lc-primary); }

.tile {
  display: block; height: 100%; text-align: left; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
  padding: 18px; color: var(--lc-ink); text-decoration: none; transition: box-shadow .15s, transform .15s;
}
a.tile:hover, button.tile:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, .08); transform: translateY(-1px); }
.tile-icon { font-size: 1.6rem; line-height: 1; margin-bottom: 10px; }
.tile-title { font-weight: 650; }
.tile-sub { font-size: .85rem; color: var(--lc-muted); margin-bottom: 8px; }
.tile-soon { opacity: .8; }
.tile-install { border-style: dashed; border-color: #a5b4fc; }
.tile-live { border-color: #c7d2fe; background: linear-gradient(160deg, #fff 40%, #eef2ff); }
.tile-go { background: linear-gradient(110deg, #4f46e5, #0ea5e9); color: #fff; font-weight: 700; }

/* ── theme switch ──────────────────────────────────────── */
.theme-quick { width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 1px solid #e5e7eb; background: #fff; font-size: 1.05rem; line-height: 1; display: grid; place-items: center; }
.theme-quick:hover { border-color: #a5b4fc; }
.theme-seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #eef2f7; }
.theme-seg button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 5px 8px; font-size: .78rem; font-weight: 650; color: #475569; white-space: nowrap; }
.theme-seg button.on { background: #fff; color: #4338ca; box-shadow: 0 1px 4px rgba(15, 23, 42, .15); }
.dropdown-menu { min-width: 250px; }

/* ── dark theme (html[data-theme=dark]) ────────────────── */
html[data-theme="dark"] { --lc-bg: #0b1020; --lc-ink: #e2e8f0; --lc-muted: #94a3b8; --bs-body-color: #e2e8f0; color-scheme: dark; }
html[data-theme="dark"] body { background: var(--lc-bg); color: #e2e8f0; }
html[data-theme="dark"] .topbar { background: #0f172a; border-color: #1e293b; }
html[data-theme="dark"] .brand, html[data-theme="dark"] .user-btn { color: #e2e8f0; }
html[data-theme="dark"] .user-btn, html[data-theme="dark"] .theme-quick { background: #111827; border-color: #263247; color: #e2e8f0; }
html[data-theme="dark"] .fy-chip { background: #1e1b4b; color: #c7d2fe; }
html[data-theme="dark"] .theme-seg { background: #1e293b; }
html[data-theme="dark"] .theme-seg button { color: #cbd5e1; }
html[data-theme="dark"] .theme-seg button.on { background: #0f172a; color: #a5b4fc; }
html[data-theme="dark"] .tile { background: #111827; border-color: #1e293b; color: #e2e8f0; }
html[data-theme="dark"] .tile-live { background: linear-gradient(160deg, #111827 40%, #1e1b4b); border-color: #312e81; }
html[data-theme="dark"] .tile-sub, html[data-theme="dark"] .text-secondary { color: #94a3b8 !important; }
html[data-theme="dark"] .tile .badge.text-bg-light { background: #1e293b !important; color: #cbd5e1 !important; }
html[data-theme="dark"] .page-login { background: #0b1020; }
html[data-theme="dark"] .login-brand { background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%); color: #e2e8f0; }
html[data-theme="dark"] .brand-points li { color: #cbd5e1; }
html[data-theme="dark"] .login-card .form-label { color: #cbd5e1; }
html[data-theme="dark"] .pass-toggle { --bs-btn-color: #cbd5e1; --bs-btn-hover-bg: #1e293b; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #1e293b; }
html[data-theme="dark"] .caps-warn { color: #fbbf24; }
.tile-go.tile-due { background: linear-gradient(110deg, #f59e0b, #ef4444); }
