/* ===== AMOM Base Styles ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-surface3); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary-dark); }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: 1.3;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }

p { color: var(--color-text-muted); line-height: 1.7; }

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-secondary); }

ul, ol { list-style: none; }

img, video { max-width: 100%; height: auto; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  transition: all var(--transition-fast);
}

input, textarea, select {
  font-family: inherit;
  font-size: var(--text-base);
  outline: none;
  border: none;
}

label { cursor: pointer; }

strong { font-weight: var(--font-semibold); color: var(--color-text); }
small { font-size: var(--text-sm); color: var(--color-text-muted); }

/* Utils */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.sr-only { position: absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

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

.text-primary   { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-danger    { color: var(--color-danger); }
.text-muted     { color: var(--color-text-muted); }
.text-subtle    { color: var(--color-text-subtle); }

.fw-normal   { font-weight: var(--font-normal); }
.fw-medium   { font-weight: var(--font-medium); }
.fw-semibold { font-weight: var(--font-semibold); }
.fw-bold     { font-weight: var(--font-bold); }

.fz-xs   { font-size: var(--text-xs); }
.fz-sm   { font-size: var(--text-sm); }
.fz-base { font-size: var(--text-base); }
.fz-lg   { font-size: var(--text-lg); }
.fz-xl   { font-size: var(--text-xl); }

.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-1   { gap: var(--sp-1); }
.flex-gap-2   { gap: var(--sp-2); }
.flex-gap-3   { gap: var(--sp-3); }
.flex-gap-4   { gap: var(--sp-4); }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.p-4     { padding: var(--sp-4); }
.p-6     { padding: var(--sp-6); }
.mb-2    { margin-bottom: var(--sp-2); }
.mb-4    { margin-bottom: var(--sp-4); }
.mb-6    { margin-bottom: var(--sp-6); }
.mt-4    { margin-top: var(--sp-4); }
.ml-auto { margin-left: auto; }

.rounded    { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pointer  { cursor: pointer; }

/* No data state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16) var(--sp-8);
  text-align: center;
}
.empty-state svg { opacity: 0.3; margin-bottom: var(--sp-4); }
.empty-state h4 { color: var(--color-text-muted); margin-bottom: var(--sp-2); }
.empty-state p  { font-size: var(--text-sm); }

/* Page loading overlay */
#page-loader {
  position: fixed; inset: 0;
  background: var(--color-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}
#page-loader.hidden { opacity: 0; pointer-events: none; }
.loader-ring {
  width: 56px; height: 56px;
  border: 3px solid var(--color-surface3);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
