/* ============================================================
   STYLE.CSS — Педагогический кластер BI прототип
   HeRo Study (hero.study) Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Brand colors */
  --color-navy:       #081B65;
  --color-blue:       #2D68C4;
  --color-orange:     #FF6D12;
  --color-green:      #78AA00;
  --color-purple:     #7657C0;
  --color-red:        #dc3912;

  /* Surfaces */
  --color-bg:         #F2F3F6;
  --color-white:      #fff;
  --color-hover:      #EEF2FF;

  /* Text */
  --color-text:       #2C3141;
  --color-text-secondary: #6B7280;
  --color-text-muted: #8891A5;
  --color-text-dim:   #A0A8B8;

  /* Borders */
  --color-border:     #E5E7EB;
  --color-border-light: #ECEEF3;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --gap:       14px;

  /* Radii */
  --radius-card:  10px;
  --radius-sm:    8px;
  --radius-pill:  20px;

  /* Shadows */
  --shadow-card:       0 2px 8px rgba(3, 22, 88, 0.06);
  --shadow-card-hover: 0 4px 16px rgba(3, 22, 88, 0.10);

  /* Chart height tiers */
  --chart-s: 300px;
  --chart-m: 400px;
  --chart-l: 500px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* ============================================================
   HERO STUDY HEADER
   ============================================================ */
.hero-header {
  background: linear-gradient(270deg, #0023A6 0%, #1E34A4 0.01%, #031658 100%);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(3, 22, 88, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.hero-header .logo {
  height: 36px;
  width: auto;
}

.hero-header .header-title {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.hero-header .header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-header .header-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.hero-header .header-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.hero-header .header-user-role {
  color: rgba(255,255,255,0.55);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.hero-header .header-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-header .header-logout:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

/* ============================================================
   NAVIGATION TABS — Apple-style text strip
   ============================================================ */
.tabs-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin-bottom: 0;
  padding: 0 20px;
  height: var(--space-xl);
  align-items: stretch;
  position: sticky;
  top: 0;
  z-index: 99;
  background: var(--color-white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar */
.tabs-nav::-webkit-scrollbar { display: none; }
.tabs-nav { -ms-overflow-style: none; scrollbar-width: none; }

.tabs-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0 var(--gap);
  height: var(--space-xl);
  color: var(--color-text-secondary);
  font-weight: 400;
  font-size: 13px;
  text-decoration: none;
  font-family: inherit;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
}

.tabs-nav a:hover {
  color: var(--color-text);
}

.tabs-nav a.active {
  color: var(--color-text);
  font-weight: 600;
  border-bottom-color: var(--color-blue);
}

/* ============================================================
   UNIVERSITY HUB — compact pill strip
   ============================================================ */
.hero-hub {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-xs) 20px;
  height: 36px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
  flex-wrap: nowrap;
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 98;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar */
.hero-hub::-webkit-scrollbar { display: none; }
.hero-hub { -ms-overflow-style: none; scrollbar-width: none; }

.hero-hub .uni-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--gap);
  height: 26px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 150ms ease;
}

.hero-hub .uni-card:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* ============================================================
   DASHBOARD GRID
   ============================================================ */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: 12px 20px var(--space-xl);
}

.grid {
  display: grid;
  gap: var(--gap);
}

/* Vertical section spacing (replaces inline margin-bottom) */
.section { margin-bottom: var(--space-md); }

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1200px) {
  .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  .tabs-nav { padding: 0 12px; }
  .tabs-nav a { padding: 0 10px; font-size: 12px; }
  .hero-header { padding: 10px 16px; }
  .hero-header .header-title { display: none; }
  .hero-header .header-user-name { font-size: 11px; }
  .hero-header .header-user-role { display: none; }
}

/* ============================================================
   CHART CARD
   ============================================================ */
.chart-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-height: 100px;
  border: 1px solid rgba(45, 104, 196, 0.06);
}

.chart-body {
  padding: var(--space-sm);
  position: relative;
}

/* ============================================================
   BIG NUMBER CARD
   ============================================================ */
.big-number {
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 18px var(--gap);
  text-align: center;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(45, 104, 196, 0.06);
  transition: box-shadow 0.2s;
}

.big-number:hover {
  box-shadow: var(--shadow-card-hover);
}

.big-number .label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  font-weight: 600;
}

.big-number .value {
  font-size: 30px;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.1;
}

.big-number .value.green  { color: var(--color-green); }
.big-number .value.red    { color: var(--color-red); }
.big-number .value.orange { color: var(--color-orange); }
.big-number .value.purple { color: var(--color-purple); }
.big-number .value.blue   { color: var(--color-blue); }

.big-number .subtext {
  font-size: 10px;
  color: var(--color-text-dim);
  margin-top: var(--space-xs);
  font-weight: 500;
}

/* ============================================================
   FULL-WIDTH CHART
   ============================================================ */
.chart-full {
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
  border: 1px solid rgba(45, 104, 196, 0.06);
}

.chart-full .chart-title {
  font-size: 13px;
  color: var(--color-text);
  font-weight: 600;
  margin-bottom: 12px;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead th {
  background: var(--color-bg);
  padding: var(--space-sm) 12px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 2px solid #D8DCE6;
  position: sticky;
  top: 0;
  font-size: 11px;
}

.data-table tbody td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.data-table tbody tr:hover {
  background: var(--color-hover);
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   INFO BOX
   ============================================================ */
.info-box {
  background: var(--color-white);
  border-left: 4px solid var(--color-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px var(--space-md);
  margin: 0 20px var(--gap);
  font-size: 13px;
  color: #4A5168;
  line-height: 1.6;
  box-shadow: 0 1px 4px rgba(3, 22, 88, 0.05);
}

.info-box strong {
  color: var(--color-navy);
}

/* ============================================================
   TIMESTAMP
   ============================================================ */
.timestamp {
  text-align: right;
  padding: 6px 20px;
  font-size: 11px;
  color: var(--color-text-dim);
  font-weight: 500;
}

/* ============================================================
   SCROLLABLE TABLE
   ============================================================ */
.table-wrapper {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
}

/* Chart height tiers */
.chart-s { height: var(--chart-s); }
.chart-m { height: var(--chart-m); }
.chart-l { height: var(--chart-l); }

/* ============================================================
   FILTER STYLES — compact pills
   ============================================================ */

/* Пилл "Все" */
.hero-hub .uni-card-all {
  background: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
  font-weight: 600;
}

.hero-hub .uni-card-all:hover {
  background: #0A2278;
}

.hero-hub .uni-card-all.active {
  background: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
}

.hero-hub .uni-card-all:not(.active) {
  background: var(--color-bg);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

/* Активный пилл ВУЗа — заливка цветом */
.hero-hub .uni-card.active:not(.uni-card-all) {
  background: var(--uni-color, var(--color-blue));
  color: var(--color-white);
  border-color: var(--uni-color, var(--color-blue));
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #C4CAD8;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-dim);
}
