/* ============================================================
   LSPA Admin Portal · Base (reset / typography / app shell)
   Shared layer — DO NOT MODIFY. Page-level styles belong in
   the page's own <style> block.
   ============================================================ */

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

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-family);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--text);
  background: var(--bg-layout);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-radius: var(--radius-sm);
}

.num, td.num, th.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */

.app-shell { display: flex; min-height: 100vh; }

.app-sider {
  width: var(--sider-width);
  flex: 0 0 auto;
  background: var(--gray-10);
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: var(--z-sticky);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}

.app-sider .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  min-height: var(--header-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sider .brand img { height: 22px; width: auto; filter: brightness(0) invert(1); }
.app-sider .brand .brand-text {
  color: #fff; font-weight: 600; font-size: 15px; line-height: 1.2;
}
.app-sider .brand .brand-sub {
  color: rgba(255, 255, 255, 0.45); font-size: 11px;
}

.sider-group-title {
  padding: 14px 16px 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.04em;
}

.sider-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.sider-menu a:hover { color: #fff; }
.sider-menu a.active {
  color: #fff;
  background: var(--primary);
  border-inline-end: 3px solid var(--primary-hover);
}

.sider-menu .menu-icon { width: 16px; height: 16px; flex: 0 0 auto; display: inline-flex; }
.sider-menu .menu-icon svg { width: 16px; height: 16px; }

.sider-foot {
  margin-top: auto;
  padding: 12px 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.app-header {
  height: var(--header-height);
  background: var(--bg-container);
  border-bottom: 1px solid var(--border-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.app-header .header-title { font-size: 15px; font-weight: 600; color: var(--text); }

.header-right { display: flex; align-items: center; gap: 18px; color: var(--text-secondary); font-size: 13px; }

.header-clock { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.header-clock svg { width: 14px; height: 14px; }

.header-user { display: flex; align-items: center; gap: 8px; cursor: pointer; position: relative; }
.header-user .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.header-user .user-name { color: var(--text); font-weight: 500; }
.header-user .user-role { color: var(--text-tertiary); font-size: 12px; }

.app-main {
  flex: 1 1 auto;
  padding: 20px 24px 48px;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}

/* ---------- Page scaffolding ---------- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.page-header .page-title { font-size: 20px; }
.page-header .page-desc { color: var(--text-secondary); margin-top: 4px; font-size: 13px; }
.page-header .page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-secondary); margin-bottom: 10px; font-size: 13px;
}
.back-link:hover { color: var(--primary); }
.back-link svg { width: 14px; height: 14px; }

/* Responsive */
@media (max-width: 992px) {
  .app-sider { width: var(--sider-collapsed-width); }
  .app-sider .brand img, .app-sider .brand .brand-text-wrap,
  .sider-menu .menu-label, .sider-group-title, .sider-foot { display: none; }
  .sider-menu a { justify-content: center; padding: 12px 0; }
  .app-main { padding: 16px 14px 40px; }
}
