/* ==========================================================================
   Base / Reset / Globals
   ========================================================================== */

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

html,
body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv01";
}

body {
  background-image:
    radial-gradient(ellipse 800px 600px at 15% -10%, rgba(180, 220, 80, 0.04), transparent 60%),
    radial-gradient(ellipse 600px 500px at 95% 100%, rgba(80, 120, 200, 0.03), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

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

/* ----- Scrollbar ----- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ----- Selection ----- */
::selection {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ----- Focus ----- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ----- Type utilities ----- */
.t-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-weight: 600;
}
.t-mono {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1;
}
.t-mute {
  color: var(--text-secondary);
}
.t-dim {
  color: var(--text-tertiary);
}
.t-up {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--text-xs);
  font-weight: 500;
}

/* ----- Layout helpers ----- */
.row {
  display: flex;
  align-items: center;
}
.row-gap-1 { gap: var(--space-1); }
.row-gap-2 { gap: var(--space-2); }
.row-gap-3 { gap: var(--space-3); }
.row-gap-4 { gap: var(--space-4); }
.row-gap-6 { gap: var(--space-6); }
.col {
  display: flex;
  flex-direction: column;
}
.spacer { flex: 1; }

.hidden {
  display: none !important;
}

/* ----- Page frame (after login) ----- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.page {
  flex: 1;
  padding: var(--space-7) var(--space-8);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  .page {
    padding: var(--space-5) var(--space-4);
  }
}
