:root {
  --page-max-width: 1240px;
  --page-edge: 24px;
  --sidebar-width: 292px;
  --surface: linear-gradient(145deg, rgba(21, 29, 46, 0.98), rgba(8, 14, 26, 0.98));
  --surface-soft: linear-gradient(145deg, rgba(30, 40, 61, 0.98), rgba(11, 18, 31, 0.98));
  --surface-muted: linear-gradient(145deg, rgba(17, 25, 39, 0.98), rgba(7, 13, 24, 0.98));
  --surface-outline: rgba(169, 191, 229, 0.18);
  --surface-line: rgba(149, 170, 208, 0.18);
  --shadow-main:
    22px 22px 44px rgba(1, 4, 10, 0.56),
    -12px -12px 28px rgba(56, 78, 114, 0.12),
    inset 1px 1px 0 rgba(202, 224, 255, 0.08),
    inset -1px -1px 0 rgba(1, 4, 10, 0.58);
  --shadow-soft:
    16px 16px 30px rgba(2, 5, 12, 0.48),
    -8px -8px 22px rgba(46, 68, 104, 0.1),
    inset 1px 1px 0 rgba(188, 214, 255, 0.06),
    inset -1px -1px 0 rgba(1, 4, 10, 0.52);
  --text-main: #f5f8ff;
  --text-soft: #d4deef;
  --text-muted: #96a9c7;
  --accent: #1089d4;
  --success: #43b979;
  --danger: #c25a67;
  --shell-font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  color: var(--text-main);
  font-family: var(--shell-font);
  background: #08111d;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(135deg, rgba(6, 17, 35, 0.86), rgba(7, 19, 40, 0.72) 34%, rgba(8, 20, 41, 0.28) 68%, rgba(5, 13, 28, 0.42)),
    url("../../img/bg3.jpg") center center / cover no-repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(128, 88, 255, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 188, 87, 0.1), transparent 24%);
}

body.sidebar-open {
  overflow: hidden;
}

a,
button,
input,
select,
textarea,
video {
  font: inherit;
}

a {
  color: inherit;
}

[hidden],
.is-hidden {
  display: none !important;
}

.panel-surface {
  border: 1px solid var(--surface-outline);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(18px);
}

.shell-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 90;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.shell-toggle:hover,
.shell-toggle:focus-visible {
  transform: scale(1.03);
  filter: drop-shadow(0 10px 22px rgba(132, 185, 243, 0.34));
  outline: none;
}

.shell-toggle img {
  width: 82px;
  height: 82px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(6, 16, 32, 0.22));
}

.shell-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  background: rgba(3, 10, 21, 0.46);
  backdrop-filter: blur(7px);
  transition: opacity 0.2s ease;
}

.shell-sidebar {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 80;
  width: min(var(--sidebar-width), calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 92px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--surface-outline);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(18px);
  transform: translateX(-24px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

body.sidebar-open .shell-scrim {
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-open .shell-sidebar {
  transform: translateX(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding-left: 2px;
  align-items: start;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(170, 189, 211, 0), rgba(170, 189, 211, 0.58), rgba(170, 189, 211, 0));
}

.sidebar-nav {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  display: grid;
  gap: 8px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(129, 153, 194, 0.32);
  border-radius: 999px;
}

.sidebar-link,
.sidebar-sublink {
  width: 100%;
  border: 0;
  color: var(--text-main);
  text-decoration: none;
}

.sidebar-link {
  min-height: 50px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible,
.sidebar-link.is-active,
.sidebar-group.has-active-child > .sidebar-link,
.sidebar-group.is-open > .sidebar-link {
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  transform: translateX(1px);
  outline: none;
}

.sidebar-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-link-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.sidebar-caret {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--text-muted);
  transition: transform 0.18s ease;
}

.sidebar-group.is-open .sidebar-caret {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: grid;
  gap: 6px;
  max-height: 0;
  overflow: hidden;
  padding: 0 0 0 14px;
  transition: max-height 0.2s ease, padding-top 0.2s ease, padding-bottom 0.2s ease;
}

.sidebar-group.is-open .sidebar-submenu,
.sidebar-group.has-active-child .sidebar-submenu {
  max-height: 280px;
  padding-top: 4px;
  padding-bottom: 6px;
}

.sidebar-sublink {
  min-height: 40px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(13, 20, 34, 0.92), rgba(23, 33, 50, 0.9));
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.sidebar-sublink:hover,
.sidebar-sublink:focus-visible,
.sidebar-sublink.is-active {
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  transform: translateX(1px);
  color: var(--text-main);
  outline: none;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 4px;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.time-widget {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 78;
  width: min(166px, calc(100vw - 28px));
  font-family: "Roboto Mono", "Courier New", monospace;
}

.time-widget-shell {
  position: relative;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(171, 193, 231, 0.16);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(20, 29, 45, 0.98), rgba(9, 15, 27, 0.98));
  box-shadow:
    12px 12px 24px rgba(2, 5, 12, 0.48),
    -6px -6px 18px rgba(50, 72, 107, 0.12),
    inset 1px 1px 0 rgba(193, 217, 255, 0.08),
    inset -1px -1px 0 rgba(1, 4, 10, 0.58);
  color: var(--text-main);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-radius 0.18s ease;
}

.time-widget-shell:hover,
.time-widget-shell:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    14px 14px 26px rgba(2, 5, 12, 0.54),
    -6px -6px 18px rgba(62, 86, 125, 0.14),
    inset 1px 1px 0 rgba(198, 222, 255, 0.1),
    inset -1px -1px 0 rgba(1, 4, 10, 0.62);
  outline: none;
}

.time-widget-shell::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 1px solid rgba(196, 219, 255, 0.08);
  pointer-events: none;
}

.time-widget.is-collapsed .time-widget-shell {
  width: 100%;
}

.time-widget-compact,
.time-widget-expanded {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  text-align: center;
  border-radius: inherit;
  background:
    radial-gradient(circle at top left, rgba(108, 146, 207, 0.16), transparent 42%),
    linear-gradient(160deg, rgba(24, 34, 53, 0.98), rgba(10, 16, 30, 0.98));
}

.time-widget-compact::before,
.time-widget-expanded::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 1px solid rgba(196, 219, 255, 0.08);
  pointer-events: none;
}

.time-widget.is-collapsed .time-widget-expanded {
  display: none;
}

.time-widget.is-expanded .time-widget-compact {
  display: none;
}

.time-widget.is-expanded .time-widget-shell {
  border-radius: 22px;
}

.time-widget-compact {
  min-height: 58px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 11px 8px;
}

.time-widget-expanded {
  min-height: 152px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding: 13px 11px 11px;
}

.time-widget-label {
  color: #9db4d7;
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.time-widget-time {
  color: #f5f8ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.05;
}

.time-widget-large-time {
  color: #f5f8ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-transform: uppercase;
}

.time-widget-date {
  color: #c8d6ee;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.time-widget-dial {
  position: relative;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(27, 37, 57, 0.98), rgba(12, 18, 31, 0.96));
  box-shadow:
    inset 5px 5px 10px rgba(1, 4, 10, 0.56),
    inset -5px -5px 10px rgba(61, 86, 126, 0.12),
    0 4px 8px rgba(1, 4, 10, 0.2);
}

.time-widget-dial::before,
.time-widget-dial::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center bottom;
  background: #dce8ff;
  border-radius: 999px;
}

.time-widget-dial::before {
  width: 2px;
  height: 12px;
  transform: translate(-50%, -92%) rotate(18deg);
}

.time-widget-dial::after {
  width: 2px;
  height: 8px;
  transform: translate(-50%, -86%) rotate(102deg);
}

.time-widget-dial-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(145deg, #f2f7ff, #9bb4de);
  box-shadow:
    0 0 0 2px rgba(16, 24, 40, 0.9),
    0 2px 4px rgba(1, 4, 10, 0.16);
}

.time-widget-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #b1c5e4;
  min-height: 0.8rem;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.time-widget-meta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(13, 20, 33, 0.86);
}

.time-widget.is-offline .time-widget-meta::before {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(13, 20, 33, 0.86);
}

.time-widget-toggle-glyph {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(26, 37, 57, 0.98), rgba(11, 18, 31, 0.98));
  box-shadow:
    0 2px 5px rgba(1, 4, 10, 0.28),
    inset 1px 1px 4px rgba(181, 207, 247, 0.08),
    inset -1px -1px 4px rgba(1, 4, 10, 0.66);
}

.time-widget-toggle-glyph::before,
.time-widget-toggle-glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #d4e2fb;
}

.time-widget-toggle-glyph::before {
  width: 8px;
  height: 2px;
}

.time-widget-toggle-glyph::after {
  width: 2px;
  height: 8px;
}

.time-widget.is-expanded .time-widget-toggle-glyph::after {
  opacity: 0;
}

[data-admin-only][hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  :root {
    --page-edge: 12px;
  }

  .shell-toggle {
    top: 12px;
    left: 12px;
  }

  .shell-toggle img {
    width: 74px;
    height: 74px;
  }

  .shell-sidebar {
    top: 14px;
    left: 14px;
    width: min(290px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    padding-top: 84px;
  }

  .time-widget {
    top: 14px;
    right: 14px;
    width: min(154px, calc(100vw - 28px));
  }
}
