/* =====================================================================
   Shule Yangu — design system v2. Bold modern SaaS language in the
   spirit of Linear / Stripe / Vercel: a single confident indigo-violet
   accent, glassy elevated cards, generous whitespace, dot-indicator
   status pills, and understated motion on interaction.
   ===================================================================== */

:root {
  --ink: #0f1115;          /* near-black text */
  --text: #16181d;
  --subtle: #6b7280;
  --faint: #9aa1ac;
  --bg: #fafafb;
  --card: #ffffff;
  --border: rgba(15,17,21,.09);
  --border-strong: rgba(15,17,21,.16);

  --accent: #5e6ad2;        /* indigo */
  --accent-2: #8b5cf6;      /* violet — gradient partner */
  --accent-ink: #4338ca;    /* darker, for hover/active text-on-light */
  --accent-wash: #eef0fd;   /* very light tint for active/selected bg */
  --accent-gradient: linear-gradient(135deg, var(--accent), var(--accent-2));

  --sidebar-bg: #0b0c10;
  --sidebar-bg-2: #15161f;

  --green: #12b76a; --green-bg: #ecfdf3;
  --red: #f04438;   --red-bg: #fef3f2;
  --amber: #f79009; --amber-bg: #fffaeb;
  --gray: #6b7280;  --gray-bg: #f1f2f4;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(15,17,21,.04), 0 4px 14px rgba(15,17,21,.05);
  --shadow-card-hover: 0 4px 10px rgba(15,17,21,.06), 0 14px 32px rgba(15,17,21,.09);
  --shadow-pop: 0 20px 60px rgba(10,10,20,.28);
  --shadow-accent: 0 2px 6px rgba(94,106,210,.28), 0 8px 20px rgba(94,106,210,.18);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.subtle { color: var(--subtle); }
h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.icon { display: block; flex-shrink: 0; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.page { animation: fadeInUp .32s cubic-bezier(.2,.7,.3,1); }

/* ---- Auth screens ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: #0a0b10;
  padding: 20px;
}
.auth-wrap::before, .auth-wrap::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; pointer-events: none;
}
.auth-wrap::before { width: 520px; height: 520px; background: radial-gradient(circle, var(--accent), transparent 70%); top: -180px; left: -120px; }
.auth-wrap::after { width: 480px; height: 480px; background: radial-gradient(circle, var(--accent-2), transparent 70%); bottom: -200px; right: -140px; }
.auth-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.98); border-radius: 16px; padding: 38px 34px;
  width: 100%; max-width: 384px; box-shadow: var(--shadow-pop);
  border: 1px solid rgba(255,255,255,.12);
}
.auth-logo {
  width: 50px; height: 50px; border-radius: 12px; background: var(--accent-gradient);
  color: #fff; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; box-shadow: var(--shadow-accent);
}
.auth-card h1 { text-align: center; font-size: 20px; margin: 0 0 5px; }
.auth-card .page-sub { text-align: center; margin-bottom: 24px; font-size: 13px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--subtle); }

/* ---- Layout ---- */
.shell { display: flex; min-height: 100vh; }
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }
.sidebar {
  width: 248px; background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2)); color: rgba(255,255,255,.88); flex-shrink: 0;
  display: flex; flex-direction: column; padding: 0;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 18px; margin-bottom: 4px;
}
.sidebar .brand-icon {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff;
  box-shadow: var(--shadow-accent);
}
.sidebar .brand-name { font-weight: 700; font-size: 14px; line-height: 1.25; letter-spacing: -.01em; color: #fff; }
.sidebar .brand .page-sub { color: rgba(255,255,255,.4); font-size: 11px; margin-top: 1px; }
.nav-list { padding: 4px 12px; flex: 1; }
.nav-item {
  position: relative;
  padding: 9px 11px; margin-bottom: 2px; border-radius: 9px; cursor: pointer;
  font-size: 13.5px; color: rgba(255,255,255,.58); font-weight: 500;
  display: flex; align-items: center; gap: 11px; transition: background .15s, color .15s;
}
.nav-item .icon { color: rgba(255,255,255,.42); transition: color .15s; }
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.92); }
.nav-item:hover .icon { color: rgba(255,255,255,.8); }
.nav-item.active { background: rgba(94,106,210,.16); color: #fff; font-weight: 600; }
.nav-item.active .icon { color: #a5aefc; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--accent-gradient);
}
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; margin-bottom: 4px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-gradient);
  color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; letter-spacing: .02em;
}
.user-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.3; }
.sidebar-footer .subtle { color: rgba(255,255,255,.4); font-size: 11.5px; }
.sidebar-footer .signout { color: #fca5a5; cursor: pointer; font-size: 12.5px; padding: 6px; font-weight: 600; }
.sidebar-footer .signout:hover { text-decoration: underline; }
.main { flex: 1; min-width: 0; }
.topbar { display:none; }
.page { padding: 30px 36px; max-width: 1240px; margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.page-title { font-size: 23px; margin: 0; letter-spacing: -.02em; }
.page-sub { color: var(--subtle); font-size: 12.5px; margin-top: 4px; }

/* ---- Cards / grid ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow-card); transition: box-shadow .18s, transform .18s; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-3 > .card, .grid-2 > .card { margin-bottom: 0; }
.grid-3 > .card:hover, .grid-2 > .card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-1px); }
.section-title { font-weight: 600; font-size: 12px; margin-bottom: 12px; color: var(--subtle); text-transform: uppercase; letter-spacing: .05em; }
.row-between { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.row-between:last-child { border-bottom: none; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--subtle); }
.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13.5px; background: #fff; color: var(--text); font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-wash); }
.select { appearance: auto; }

/* ---- Buttons ---- */
.btn { padding: 10px 17px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s cubic-bezier(.2,.7,.3,1); }
.btn-primary { background: var(--accent-gradient); color: #fff; box-shadow: var(--shadow-accent); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(94,106,210,.34), 0 12px 26px rgba(94,106,210,.24); filter: brightness(1.04); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: #f7f7f9; border-color: var(--subtle); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #fde1df; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.icon-btn { background: transparent; border: none; cursor: pointer; padding: 6px; display: flex; color: inherit; border-radius: 7px; transition: background .15s; }
.icon-btn:hover { background: rgba(0,0,0,.05); }

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 14px; color: var(--subtle); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fbfbfd; }
.empty-state { text-align: center; color: var(--subtle); padding: 32px !important; font-size: 13px; }

/* ---- Badges (status pills with a dot indicator) ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 15px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--subtle); border-bottom: 2px solid transparent; white-space: nowrap; transition: color .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---- Toasts ---- */
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 999; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: #16181d; color: #fff; padding: 11px 17px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-pop); animation: fadeInUp .25s cubic-bezier(.2,.7,.3,1); }
.toast.success { background: #0a6b3d; }
.toast.error { background: #a1281f; }

/* ---- Lock screen ---- */
.lock-wrap { min-height: 100vh; display:flex; align-items:center; justify-content:center; background: #0a0b10; color:#fff; padding:20px; text-align:center; position: relative; overflow: hidden; }
.lock-wrap::before { content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%; filter: blur(90px); opacity: .5; background: radial-gradient(circle, var(--red), transparent 70%); top: -160px; right: -120px; }
.lock-card { max-width: 420px; position: relative; z-index: 1; }
.lock-icon { width: 58px; height: 58px; border-radius: 16px; background: rgba(255,255,255,.08); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; border: 1px solid rgba(255,255,255,.1); }

/* ---- Responsive: sidebar becomes a slide-in drawer below 860px ---- */
@media (max-width: 860px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: var(--sidebar-bg); color: #fff; position: sticky; top: 0; z-index: 30;
  }
  .mobile-topbar .icon-btn { color: #fff; }
  .mobile-topbar .icon-btn:hover { background: rgba(255,255,255,.1); }
  .mobile-topbar-brand { font-weight: 600; font-size: 14px; }
  .shell { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: 268px;
    transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.7,.3,1); box-shadow: var(--shadow-pop);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(8,9,14,.55); backdrop-filter: blur(2px); z-index: 40;
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .page { padding: 20px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-3 > .card, .grid-2 > .card { margin-bottom: 0; }
}
@media (min-width: 861px) {
  .sidebar { position: relative; transform: none; }
}
