/* =========================================================
   NULLBRIEF APP.CSS
   Shared design system for:
   - index.html
   - login.html
   - register.html
   - dashboard.html
   ========================================================= */

/* ---------- ROOT TOKENS ---------- */

:root {
  color-scheme: dark;

  --bg: #070910;
  --bg-soft: #0b0f1a;
  --surface: rgba(15, 19, 33, 0.86);
  --surface-strong: #111729;
  --surface-hover: #151d33;
  --surface-muted: rgba(255, 255, 255, 0.035);

  --text: #f8fafc;
  --text-soft: #d7deea;
  --text-muted: #9aa6ba;
  --text-faint: #6f7a8d;

  --primary: #7c5cff;
  --primary-2: #38bdf8;
  --primary-3: #a78bfa;
  --primary-soft: rgba(124, 92, 255, 0.14);
  --primary-border: rgba(124, 92, 255, 0.34);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.12);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.12);

  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.065);
  --divider: rgba(255, 255, 255, 0.07);

  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.45);
  --shadow-primary: 0 20px 50px rgba(124, 92, 255, 0.28);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --container: 1180px;
  --topbar-height: 72px;
  --sidebar-width: 260px;

  --transition-fast: 160ms ease;
  --transition: 240ms ease;
  --transition-slow: 420ms ease;
}

/* ---------- RESET ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(124, 92, 255, 0.20), transparent 32%),
    radial-gradient(circle at 90% 0%, rgba(56, 189, 248, 0.12), transparent 28%),
    linear-gradient(180deg, #090b13 0%, #070910 48%, #080b12 100%);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

::selection {
  color: white;
  background: rgba(124, 92, 255, 0.55);
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.7rem, 7vw, 5.8rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

h4 {
  font-size: 1.05rem;
}

/* ---------- LAYOUT ---------- */

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: 6rem;
}

.section-sm {
  padding-block: 3.5rem;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.grid {
  display: grid;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stack {
  display: grid;
}

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.block {
  display: block;
}

.hidden {
  display: none !important;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.justify-start {
  justify-content: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 1.5rem;
}

.gap-4 {
  gap: 2rem;
}

.w-full {
  width: 100%;
}

.mx-auto {
  margin-inline: auto;
}

/* ---------- TYPOGRAPHY ---------- */

.title {
  max-width: 900px;
  margin-bottom: 1rem;
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.subtitle {
  max-width: 720px;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  line-height: 1.75;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: #c4b5fd;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 10%, #c4b5fd 46%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-muted {
  color: var(--text-muted);
}

.text-faint {
  color: var(--text-faint);
}

.text-primary {
  color: #b8aaff;
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 700;
}

.font-bold {
  font-weight: 800;
}

/* ---------- NAVBAR ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--topbar-height);
  border-bottom: 1px solid var(--border-soft);
  background: rgba(7, 9, 16, 0.76);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.navbar-inner {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: max-content;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.32);
  color: white;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 650;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

/* ---------- CARDS ---------- */

.card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.04), transparent 30%),
    radial-gradient(circle at top right, rgba(124, 92, 255, 0.09), transparent 36%);
}

.card > * {
  position: relative;
  z-index: 1;
}

.card-hover {
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.card-hover:hover {
  transform: translateY(-6px);
  border-color: var(--primary-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    var(--surface-strong);
  box-shadow: var(--shadow-md);
}

.card-header,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-header {
  margin-bottom: 1.25rem;
}

.card-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--divider);
}

.glass {
  background: rgba(14, 18, 30, 0.72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.glow {
  position: relative;
}

.glow::after {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: -1;
  border-radius: 50%;
  background: rgba(124, 92, 255, 0.18);
  filter: blur(60px);
}

/* ---------- BUTTONS ---------- */

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), #5c46e8);
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.22);
  color: white;
  font-size: 0.93rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    opacity var(--transition-fast);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 3px solid rgba(124, 92, 255, 0.35);
  outline-offset: 3px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
  color: var(--text);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.085);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #be123c);
  box-shadow: 0 12px 30px rgba(244, 63, 94, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.2);
}

.btn-sm {
  min-height: 38px;
  padding: 0.62rem 0.85rem;
  border-radius: 11px;
  font-size: 0.84rem;
}

.btn-lg {
  min-height: 52px;
  padding: 0.92rem 1.25rem;
  border-radius: 15px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 44px;
  padding: 0;
}

.btn.is-loading {
  pointer-events: none;
}

/* ---------- FORMS ---------- */

.form {
  display: grid;
  gap: 1rem;
}

.form-group {
  display: grid;
  gap: 0.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.label {
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 750;
}

.label-required::after {
  content: " *";
  color: var(--danger);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(7, 10, 18, 0.82);
  color: var(--text);
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.input,
.select {
  padding: 0.82rem 0.95rem;
}

.textarea {
  min-height: 130px;
  resize: vertical;
  padding: 0.95rem;
}

.input::placeholder,
.textarea::placeholder {
  color: #647083;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary);
  background: rgba(9, 12, 22, 0.98);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.14);
}

.input.is-invalid,
.textarea.is-invalid,
.select.is-invalid,
.input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.10);
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 5rem;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  min-width: 58px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.input-action:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.help-text {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.error-text {
  margin: 0;
  color: var(--danger);
  font-size: 0.78rem;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

/* ---------- BADGES ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: fit-content;
  min-height: 28px;
  padding: 0.34rem 0.62rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.badge-primary {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: #c4b5fd;
}

.badge-success {
  border-color: rgba(52, 211, 153, 0.26);
  background: var(--success-soft);
  color: #6ee7b7;
}

.badge-warning {
  border-color: rgba(251, 191, 36, 0.26);
  background: var(--warning-soft);
  color: #fde68a;
}

.badge-danger {
  border-color: rgba(251, 113, 133, 0.26);
  background: var(--danger-soft);
  color: #fda4af;
}

/* ---------- ALERTS ---------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.alert-success {
  border-color: rgba(52, 211, 153, 0.28);
  background: var(--success-soft);
  color: #a7f3d0;
}

.alert-danger {
  border-color: rgba(251, 113, 133, 0.28);
  background: var(--danger-soft);
  color: #fecdd3;
}

.alert-warning {
  border-color: rgba(251, 191, 36, 0.28);
  background: var(--warning-soft);
  color: #fde68a;
}

.alert-info {
  border-color: rgba(56, 189, 248, 0.28);
  background: var(--info-soft);
  color: #bae6fd;
}

/* ---------- STATS ---------- */

.stat-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-label {
  margin-bottom: 0.6rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.stat-value {
  margin-bottom: 0.65rem;
  color: var(--text);
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
}

.stat-change {
  font-size: 0.78rem;
  font-weight: 750;
}

/* ---------- TABLES ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.table th,
.table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--divider);
}

.table th {
  color: var(--text-faint);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table td {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- DIVIDERS ---------- */

.divider {
  width: 100%;
  height: 1px;
  background: var(--divider);
}

/* ---------- APP SHELL ---------- */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-right: 1px solid var(--border-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    rgba(9, 12, 21, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.sidebar-nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.72rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 750;
  transition:
    color var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-link.is-active {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: #d8d1ff;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.25rem;
}

.app-main {
  min-width: 0;
  padding: 1.25rem;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.25rem;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--primary-border);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.24), rgba(56, 189, 248, 0.12));
  color: white;
  font-weight: 900;
}

/* ---------- PROGRESS ---------- */

.progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

/* ---------- LOADING ---------- */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  animation: shimmer 1.5s infinite;
}

/* ---------- MODALS ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(100%, 560px);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
}

/* ---------- DROPDOWNS ---------- */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 80;
  width: min(260px, 90vw);
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(14, 18, 30, 0.98);
  box-shadow: var(--shadow-md);
}

.dropdown-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.dropdown-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- TOASTS ---------- */

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 120;
  display: grid;
  gap: 0.75rem;
  width: min(380px, calc(100vw - 2rem));
}

.toast {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(14, 18, 30, 0.96);
  box-shadow: var(--shadow-md);
}

/* ---------- ANIMATIONS ---------- */

.slide-up {
  animation: slideUp 0.72s cubic-bezier(.2,.75,.2,1) both;
}

.fade-in {
  animation: fadeIn 0.5s ease both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* ---------- MARGINS ---------- */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* ---------- PADDING ---------- */

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ---------- WIDTHS ---------- */

.max-w-sm { max-width: 420px; }
.max-w-md { max-width: 560px; }
.max-w-lg { max-width: 760px; }
.max-w-xl { max-width: 960px; }

/* ---------- ACCESSIBILITY ---------- */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:focus-visible {
  outline: 3px solid rgba(124, 92, 255, 0.38);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1024px) {
  .nav-links {
    display: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    width: min(var(--sidebar-width), 86vw);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .section {
    padding-block: 4.5rem;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 64px;
  }

  .container {
    width: min(calc(100% - 1rem), var(--container));
  }

  .navbar-inner {
    gap: 0.75rem;
  }

  .brand {
    font-size: 1rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.15rem;
    border-radius: 18px;
  }

  .app-main {
    padding: 0.8rem;
  }

  .topbar {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .navbar .btn {
    min-height: 36px;
    padding-inline: 0.7rem;
    font-size: 0.78rem;
  }

  .title {
    font-size: clamp(2.4rem, 15vw, 3.8rem);
  }

  .btn-lg {
    min-height: 48px;
  }
}

/* ---------- REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- PRINT ---------- */

@media print {
  body {
    color: black;
    background: white;
  }

  body::before,
  .navbar,
  .sidebar,
  .btn,
  .toast-container {
    display: none !important;
  }

  .card {
    border: 1px solid #ccc;
    box-shadow: none;
    background: white;
  }

  .app-shell {
    display: block;
  }

  .app-main {
    padding: 0;
  }
}
