/* ==========================================================================
   DOST-IskoLens — Global Design Tokens & Base Styles
   ========================================================================== */

@import url('../vendor/fonts/fonts.css');

:root {
  /* ---- Brand colors ---- */
  --navy-950: #0a0f1e;
  --navy-900: #0d1526;
  --navy-850: #101a2e;
  --navy-800: #131f38;
  --navy-700: #1a2740;
  --navy-600: #253552;
  --navy-border: #24304a;

  --blue-600: #1e5fd9;
  --blue-500: #2f6fe6;
  --blue-accent: #3b82f6;
  --blue-50: #eef4ff;

  --sky-400: #38bdf8;

  /* ---- Status colors ---- */
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-50: #ecfdf3;
  --green-100: #d1fae5;
  --green-text: #15803d;

  --amber-500: #f59e0b;
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-text: #b45309;

  --red-600: #dc2626;
  --red-500: #ef4444;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-text: #b91c1c;

  --purple-500: #8b5cf6;
  --purple-50: #f5f3ff;

  /* ---- Neutrals ---- */
  --white: #ffffff;
  --gray-25: #f8fafc;
  --gray-50: #f4f6fa;
  --gray-100: #eef1f6;
  --gray-200: #e2e7ef;
  --gray-300: #cbd3e1;
  --gray-400: #94a1b8;
  --gray-500: #6b7791;
  --gray-600: #4c576e;
  --gray-700: #374158;
  --gray-800: #232c3f;
  --gray-900: #141b2b;

  /* ---- Typography ---- */
  --font-display: 'Poppins', 'Inter', sans-serif;
  --font-body: 'Inter', 'Poppins', sans-serif;

  /* ---- Layout ---- */
  --sidebar-width: 264px;
  --sidebar-width-collapsed: 76px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 2px 8px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.12);
  --shadow-modal: 0 20px 60px rgba(8, 12, 24, 0.35);

  --transition: 0.18s ease;
}

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

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.25;
}

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

button {
  font-family: var(--font-body);
  cursor: pointer;
}

input, select, textarea {
  font-family: var(--font-body);
}

ul {
  list-style: none;
}

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

:focus-visible {
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
}

/* ---- App Shell ---- */
.app-shell {
  display: flex;
  min-height: calc(100vh / var(--ui-zoom, 1));
}

.main-content {
  flex: 1;
  min-width: 0; /* lets wide content shrink/scroll inside instead of stretching the whole page */
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh / var(--ui-zoom, 1));
  transition: margin-left var(--transition);
}

.app-shell.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-width-collapsed);
}

.page-body {
  padding: 24px 32px 48px;
  flex: 1;
}

.breadcrumb {
  font-size: 12.5px;
  color: var(--gray-500);
  margin-top: 2px;
}

.breadcrumb a {
  color: var(--blue-600);
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-row h1 {
  font-size: 18px;
}

.page-title-block h1 {
  font-size: 18px;
  font-weight: 700;
}

.page-lead {
  color: var(--gray-500);
  font-size: 13px;
  margin-top: 6px;
  max-width: 760px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy-900);
  margin: 28px 0 14px;
  scroll-margin-top: 24px;
}

.section-heading .icon-badge {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-50);
  color: var(--blue-600);
  font-size: 14px;
}

.section-heading:first-child {
  margin-top: 0;
}

.text-muted { color: var(--gray-500); }
.text-sm { font-size: 12.5px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* Scrollbar polish */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--gray-500);
}
.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 15px;
  color: var(--gray-700);
  margin-bottom: 6px;
}

/* ---------- Smoother page changes ---------- */
/* Crossfade between pages (Chrome / Edge 126+): the old page stays on screen until the new one is ready. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; animation-timing-function: ease-out; }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }
/* The page background is painted before any script runs, so there is no white flash. */
html { background: var(--gray-50); }
/* The sidebar and top bar are drawn by a script; until then their places are painted in their final colours. */
#sidebar-mount:empty { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width); background: var(--navy-900); z-index: 1; }
#topbar-mount:empty { height: var(--topbar-height); background: var(--navy-900); }
/* Analytics cards show a light placeholder while their data loads. */
[id^="c-"]:empty { min-height: 160px; border-radius: var(--radius-md); background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: isk-skeleton 1.4s ease-in-out infinite; }
@keyframes isk-skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { [id^="c-"]:empty { animation: none; } }
@media (max-width: 900px) { #sidebar-mount:empty { display: none; } }
