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

:root {
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --text-dim: rgba(255, 255, 255, 0.72);
  --btn-bg: rgba(255, 255, 255, 0.10);
  --btn-hover: rgba(255, 255, 255, 0.22);
  --clock-bg: rgba(255, 255, 255, 0.18);
  --dock-bg: rgba(255, 255, 255, 0.12);
  --panel-bg: rgba(10, 26, 56, 0.18);
  --panel-bg-2: rgba(7, 18, 39, 0.05);
  --border: rgba(255, 255, 255, 0.14);
  --accent: #59c3ff;
  --accent-hover: #3fb1f2;
  --active: #59c3ff;
  --danger: #ff5a5a;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

html, body { min-height: 100%; }

body {
  font-family: Arial, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background: #071122;
}

/* ── Video background (matches ODA4) ── */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at top left, rgba(20, 55, 110, 0.25), transparent 32%),
    radial-gradient(circle at top right, rgba(16, 83, 145, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(5, 13, 26, 0.45), rgba(8, 22, 46, 0.40), rgba(12, 40, 78, 0.38));
  backdrop-filter: blur(1px);
}

/* App-shell: the page is exactly one viewport tall and never scrolls itself —
   the dock stays pinned and only .workspace scrolls (like ODA4 sub-pages). */
.page {
  height: 100vh;
  height: 100dvh;
  padding: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Top bar / dock ── */
.topbar {
  display: grid;
  grid-template-columns: 200px 1fr 170px;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.brand-box {
  display: flex;
  align-items: center;
}

.brand-logo {
  font-size: 37px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 0 18px rgba(89, 195, 255, 0.55);
}

.top-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.dock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 28px;
  background: var(--dock-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  box-shadow: var(--shadow);
}

.dock-item {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: var(--btn-bg);
  border: 1px solid var(--border);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.18);
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  font: inherit;
  padding: 0;
}

.dock-item:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
}

.dock-item svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  transition: transform 0.18s ease;
}

.dock-item:hover svg {
  transform: scale(1.08);
}

.dock-item.active {
  background: rgba(255,255,255,0.32);
  border-color: rgba(89, 195, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.09),
    0 8px 18px rgba(0,0,0,0.20),
    0 0 20px rgba(89, 195, 255, 0.12);
}

.indicator {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%) scale(0.8);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--active);
  box-shadow: 0 0 14px rgba(89, 195, 255, 0.9);
  opacity: 0;
  transition: 0.18s ease;
}

.dock-item.active .indicator {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.clock-box {
  min-width: 160px;
  height: 58px;
  border-radius: 18px;
  background: var(--clock-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  user-select: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.18);
}

.clock-colon {
  display: inline-block;
  width: 10px;
  text-align: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.clock-colon.blink-off { opacity: 0.2; }

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

/* ── Layout / workspace (single glass panel, like ODA4 sub-pages) ── */
.layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 28px;
  background: var(--panel-bg);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.workspace::-webkit-scrollbar { width: 8px; }
.workspace::-webkit-scrollbar-track { background: transparent; }
.workspace::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
}
.workspace::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.32); }

/* Frosted header strip inside the scroll panel: content blurs as it slides
   under it while scrolling — the "ODA4-like" scroll feel. */
.workspace-top {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -28px -32px 22px;
  padding: 26px 32px 14px;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(10, 26, 56, 0.78) 0%,
    rgba(10, 26, 56, 0.55) 62%,
    rgba(10, 26, 56, 0) 100%
  );
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  pointer-events: none;
}
.workspace-top > * { pointer-events: auto; }

/* ── Page content ── */
.page-title {
  margin: 0 0 6px;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 800;
}

.page-subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.nav-card {
  display: block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  backdrop-filter: blur(12px);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.nav-card:hover {
  border-color: rgba(89, 195, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.nav-card--disabled { opacity: 0.5; cursor: not-allowed; }

.nav-card__title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.nav-card__desc { font-size: 13.5px; color: var(--muted); }

.nav-card--logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  min-height: 120px;
  padding: 28px;
}
.nav-card--logo img {
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
}
.nav-card--logo-sm {
  min-width: 184px;
  min-height: 86px;
  padding: 19px;
}
.nav-card--logo-sm img {
  max-width: 160px;
}

/* Diploma form */
.diploma-form { max-width: 680px; width: 100%; font-size: 14px; margin: 0 auto; }
.form-row { margin-bottom: 14px; }
.form-row--pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row--quad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) {
  .form-row--quad { grid-template-columns: 1fr 1fr; }
}

.form-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 0 12px;
  background: rgba(255,255,255,0.10);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  height: 42px;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, background 0.2s ease;
}

select.form-input { height: 42px; padding: 0 10px; }
.form-input option { color: #000; }

.form-input:focus {
  outline: none;
  border-color: rgba(89, 195, 255, 0.5);
  background: rgba(255,255,255,0.16);
}

.form-error { color: var(--danger); font-size: 13px; margin-top: 6px; }

.dative-preview {
  display: none;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  padding: 8px 12px;
  background: rgba(89, 195, 255, 0.08);
  border: 1px solid rgba(89, 195, 255, 0.18);
  border-radius: 10px;
}

/* Tables */
.lines-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  font-size: 14px;
}

.lines-table th, .lines-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.lines-table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(255, 255, 255, 0.07);
}

.lines-table tr:last-child td { border-bottom: none; }
.lines-table tr:hover td { background: rgba(255, 255, 255, 0.05); }

/* ── Login page (matches ODA4 login.html) ── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  border-radius: 28px;
  background: rgba(10, 26, 56, 0.52);
  border: 1px solid rgba(255,255,255,0.13);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

.login-title {
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #fff;
  letter-spacing: -0.5px;
}

.login-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 32px;
}

.login-field { margin-bottom: 18px; }

.login-field input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.09);
  color: #fff;
  font-size: 15px;
  outline: none;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}

.login-field input::placeholder { color: rgba(255,255,255,0.38); }

.login-field input:focus {
  border-color: rgba(89, 195, 255, 0.5);
  background: rgba(255,255,255,0.14);
}

.login-btn {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  background: rgba(89, 195, 255, 0.22);
  border: 1px solid rgba(89, 195, 255, 0.35);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.5px;
}

.login-btn:hover { background: rgba(89, 195, 255, 0.38); transform: translateY(-1px); }

.login-error {
  color: #ff7b7b;
  font-size: 13px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 80, 80, 0.2);
}

/* Compact icon action buttons (diploma view links) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  border-color: rgba(89, 195, 255, 0.45);
  color: var(--accent);
  background: rgba(89, 195, 255, 0.12);
}

.icon-btn svg { width: 16px; height: 16px; }

.icon-btn__badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 8.5px;
  font-weight: 700;
  background: var(--accent);
  color: #071122;
  border-radius: 50%;
  width: 13px;
  height: 13px;
  line-height: 13px;
  text-align: center;
}

@media (max-width: 1150px) {
  .topbar { grid-template-columns: 1fr; gap: 16px; }
  .brand-box, .top-right { justify-content: center; }
  .top-center { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  /* On phones the wrapped dock is tall, so drop the app-shell and let the
     whole page scroll normally instead of squeezing the panel. */
  .page { padding: 14px; height: auto; min-height: 100vh; overflow: visible; }
  .dock { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .dock::-webkit-scrollbar { display: none; }
  .dock-item { width: 54px; height: 54px; border-radius: 16px; flex: 0 0 auto; }
  .clock-box { min-width: 130px; font-size: 22px; height: 52px; }
  .workspace { padding: 18px; overflow-y: visible; }
  .workspace-top {
    position: static;
    margin: -18px -18px 18px;
    padding: 18px 18px 12px;
  }
}
