:root {
  --bg: #030303;
  --bg-soft: #090909;
  --panel: rgba(14, 14, 14, 0.88);
  --panel-strong: rgba(8, 8, 8, 0.96);
  --panel-hover: rgba(20, 20, 20, 0.95);
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(224, 177, 66, 0.3);
  --gold: #e0b142;
  --gold-strong: #ffd568;
  --gold-dark: #8c5c0e;
  --gold-faint: rgba(224, 177, 66, 0.1);
  --text: #f7f4ed;
  --muted: #908f8b;
  --muted-2: #676762;
  --success: #5bd19b;
  --danger: #ff6e68;
  --warning: #e8b75b;
  --sidebar-width: 292px;
  --topbar-height: 92px;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

img,
svg {
  display: block;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection {
  color: #111;
  background: var(--gold-strong);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #080808;
}

::-webkit-scrollbar-thumb {
  border: 2px solid #080808;
  border-radius: 20px;
  background: #34302a;
}

::-webkit-scrollbar-thumb:hover {
  background: #54462e;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: -5;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(202, 148, 33, 0.12), transparent 36%),
    linear-gradient(180deg, #050505 0%, #020202 100%);
}

.ambient {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.13;
}

.ambient-one {
  top: -280px;
  right: 7%;
  background: #efb53a;
}

.ambient-two {
  bottom: -340px;
  left: -180px;
  background: #6b4e17;
}

.gold-grid {
  position: absolute;
  inset: 0;
  opacity: 0.23;
  background-image:
    linear-gradient(rgba(255, 220, 132, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 220, 132, 0.025) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.noise-layer {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 220px 80px rgba(0, 0, 0, 0.62);
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 35%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 30%);
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.nav-item:focus-visible,
.text-btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn-primary {
  color: #120e05;
  border-color: #f0c659;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 35%),
    linear-gradient(135deg, #f8d96e 0%, #d89b25 55%, #a66b0d 100%);
  box-shadow: 0 10px 26px rgba(199, 137, 24, 0.2), inset 0 1px rgba(255, 255, 255, 0.45);
}

.btn-primary:hover {
  box-shadow: 0 13px 34px rgba(225, 168, 52, 0.3), inset 0 1px rgba(255, 255, 255, 0.5);
}

.btn-secondary {
  color: var(--text);
  border-color: rgba(224, 177, 66, 0.24);
  background: rgba(224, 177, 66, 0.075);
}

.btn-secondary:hover {
  border-color: rgba(224, 177, 66, 0.5);
  background: rgba(224, 177, 66, 0.12);
}

.btn-ghost {
  color: #c8c5bc;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.btn-ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.055);
}

.btn-danger {
  color: #fff;
  border-color: rgba(255, 110, 104, 0.4);
  background: rgba(255, 110, 104, 0.15);
}

.btn-danger:hover {
  background: rgba(255, 110, 104, 0.24);
}

.btn-full {
  width: 100%;
}

.btn-large {
  min-height: 54px;
}

.icon-btn {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  color: #c8c4bb;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  transition: 160ms ease;
}

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

.icon-btn:hover {
  color: var(--gold-strong);
  border-color: rgba(224, 177, 66, 0.35);
  background: rgba(224, 177, 66, 0.08);
}

/* Intro */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(173, 117, 16, 0.14), transparent 28%),
    #020202;
  transition: opacity 650ms ease, visibility 650ms ease;
}

.intro-overlay.finished {
  visibility: hidden;
  opacity: 0;
}

.intro-lines {
  position: absolute;
  inset: -30%;
  opacity: 0.45;
  background:
    repeating-linear-gradient(90deg, transparent 0 119px, rgba(231, 184, 75, 0.06) 120px),
    repeating-linear-gradient(0deg, transparent 0 119px, rgba(231, 184, 75, 0.04) 120px);
  transform: perspective(800px) rotateX(63deg) translateY(32%);
  transform-origin: center;
  animation: introGrid 9s linear infinite;
}

@keyframes introGrid {
  to { transform: perspective(800px) rotateX(63deg) translateY(20%); }
}

.intro-skip {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 4;
  padding: 9px 13px;
  color: #8b8984;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.35);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.intro-skip:hover {
  color: var(--gold);
  border-color: rgba(224, 177, 66, 0.3);
}

.intro-center {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100vw - 40px));
  text-align: center;
}

.intro-emblem-wrap {
  position: relative;
  display: grid;
  width: 290px;
  height: 290px;
  place-items: center;
  margin: 0 auto 16px;
}

.intro-logo {
  position: relative;
  z-index: 4;
  width: 205px;
  filter: drop-shadow(0 18px 45px rgba(223, 169, 49, 0.2));
  animation: introLogo 3.2s ease both;
}

@keyframes introLogo {
  0% { opacity: 0; transform: scale(0.82); filter: blur(8px); }
  40% { opacity: 1; filter: blur(0); }
  100% { transform: scale(1); }
}

.intro-ring {
  position: absolute;
  inset: 15px;
  border: 1px solid rgba(224, 177, 66, 0.2);
  border-radius: 50%;
}

.ring-one {
  animation: spin 9s linear infinite;
}

.ring-one::before,
.ring-one::after,
.ring-two::before,
.ring-two::after {
  content: "";
  position: absolute;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold);
}

.ring-one::before,
.ring-one::after {
  top: -2px;
  left: 50%;
  width: 24px;
  height: 3px;
  transform: translateX(-50%);
}

.ring-one::after {
  top: auto;
  bottom: -2px;
}

.ring-two {
  inset: 42px;
  border-style: dashed;
  opacity: 0.7;
  animation: spinReverse 7s linear infinite;
}

.ring-two::before,
.ring-two::after {
  top: 50%;
  left: -2px;
  width: 3px;
  height: 18px;
  transform: translateY(-50%);
}

.ring-two::after {
  left: auto;
  right: -2px;
}

.intro-scan {
  position: absolute;
  z-index: 5;
  left: 36px;
  right: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffd56c, transparent);
  box-shadow: 0 0 16px rgba(255, 213, 108, 0.8);
  animation: scanLogo 2.5s ease-in-out infinite;
}

@keyframes scanLogo {
  0%, 100% { top: 25%; opacity: 0; }
  15%, 80% { opacity: 1; }
  50% { top: 72%; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinReverse { to { transform: rotate(-360deg); } }

.intro-center h1 {
  margin: 7px 0 20px;
  color: #efede8;
  font-family: "Teko", sans-serif;
  font-size: clamp(3.5rem, 9vw, 5.6rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 0.8;
}

.intro-center h1 span {
  color: var(--gold-strong);
}

.boot-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
}

.boot-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #80540b, #f3c856, #fff0b0);
  box-shadow: 0 0 16px rgba(238, 188, 73, 0.5);
  transition: width 180ms linear;
}

.intro-status {
  display: flex;
  justify-content: space-between;
  margin-top: 11px;
  color: #77756f;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.intro-status strong {
  color: var(--gold);
}

.intro-footer {
  position: absolute;
  right: 34px;
  bottom: 28px;
  left: 34px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  color: #55544f;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

/* Authentication */
.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.25fr) minmax(440px, 0.75fr);
}

.auth-showcase {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 36px clamp(40px, 6vw, 92px);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(circle at 42% 43%, rgba(215, 156, 36, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 35%);
}

.auth-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

.auth-showcase-top,
.auth-showcase-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #716f69;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.system-pill,
.auth-showcase-footer span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.system-pill span,
.auth-showcase-footer i,
.hero-status span,
.status-dot,
.send-status > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 14px rgba(91, 209, 155, 0.7);
}

.auth-brand-block {
  position: relative;
  z-index: 2;
  display: grid;
  max-width: 850px;
  grid-template-columns: minmax(220px, 340px) 1fr;
  align-items: center;
  gap: clamp(30px, 4vw, 64px);
  margin: 45px 0;
}

.auth-main-logo {
  width: 100%;
  filter: drop-shadow(0 28px 70px rgba(222, 163, 35, 0.19));
}

.auth-copy h1 {
  margin: 14px 0 18px;
  font-family: "Teko", sans-serif;
  font-size: clamp(4rem, 6vw, 6.9rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 0.78;
  text-transform: uppercase;
}

.auth-copy h1 span {
  color: var(--gold-strong);
}

.auth-copy > p:last-child {
  max-width: 580px;
  margin: 0;
  color: #9b9993;
  font-size: 1rem;
  line-height: 1.75;
}

.auth-metrics {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 800px;
}

.auth-metrics article {
  min-height: 120px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background: rgba(8, 8, 8, 0.52);
}

.auth-metrics span,
.auth-metrics small {
  display: block;
  color: #74726c;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-metrics strong {
  display: block;
  margin: 4px 0 2px;
  color: #f2cb65;
  font-family: "Teko", sans-serif;
  font-size: 2.5rem;
  line-height: 1;
}

.auth-panel-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 38px;
  background: rgba(2, 2, 2, 0.65);
}

.auth-card {
  width: min(100%, 470px);
  padding: 34px;
  border-color: rgba(224, 177, 66, 0.16);
}

.auth-card-logo {
  display: none;
  width: 120px;
  margin: 0 auto 22px;
}

.auth-card-logo img {
  width: 100%;
}

.auth-head h2 {
  margin: 9px 0 10px;
  font-size: clamp(1.65rem, 4vw, 2.1rem);
}

.auth-head > p:last-child,
.panel-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.stack-form {
  display: grid;
  gap: 17px;
  margin-top: 27px;
}

.stack-form label,
.two-grid label {
  display: grid;
  gap: 8px;
  color: #c7c4bd;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.045em;
}

.stack-form label > span,
.two-grid label > span {
  padding-left: 2px;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell > svg {
  position: absolute;
  left: 15px;
  width: 18px;
  height: 18px;
  color: #686762;
}

.input-shell input {
  padding-right: 78px;
  padding-left: 44px;
}

.input-action {
  position: absolute;
  right: 12px;
  padding: 5px;
  color: #8a8882;
  border: 0;
  background: transparent;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.input-action:hover {
  color: var(--gold);
}

input,
select {
  width: 100%;
  min-height: 62px;
  padding: 0 14px;
  color: #f5f2ea;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  outline: 0;
  background: rgba(2, 2, 2, 0.58);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

input::placeholder {
  color: #55534f;
}

input:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

input:focus,
select:focus {
  border-color: rgba(224, 177, 66, 0.55);
  background: rgba(5, 5, 5, 0.9);
  box-shadow: 0 0 0 4px rgba(224, 177, 66, 0.07);
}

input[readonly] {
  color: #c4a962;
  background: rgba(224, 177, 66, 0.045);
}

select option {
  color: #f2f0e9;
  background: #111;
}

.auth-security-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 19px;
  padding-top: 18px;
  color: #6f6d67;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
}

.auth-security-note svg {
  width: 17px;
  height: 17px;
  color: var(--gold);
}

/* Application layout */
.app {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 50;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(224, 177, 66, 0.035), transparent 25%),
    rgba(5, 5, 5, 0.96);
  backdrop-filter: blur(24px);
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 180px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  opacity: 0.5;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 2px 7px 21px;
}

.brand-logo {
  width: 64px;
  filter: drop-shadow(0 8px 16px rgba(224, 177, 66, 0.14));
}

.sidebar-brand > div {
  min-width: 0;
}

.brand-version {
  display: block;
  color: var(--gold);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  overflow: hidden;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.16rem;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand small {
  margin-top: 2px;
  color: #66645e;
  font-size: 0.8rem;
}

.sidebar-status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid rgba(91, 209, 155, 0.12);
  border-radius: 12px;
  background: rgba(91, 209, 155, 0.035);
}

.sidebar-status span,
.sidebar-status strong {
  display: block;
}

.sidebar-status span {
  color: #71706b;
  font-size: 0.64rem;
}

.sidebar-status strong {
  margin-top: 2px;
  color: var(--success);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.11em;
}

.sidebar-status > svg {
  width: 17px;
  height: 17px;
  color: #5aa987;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 25px;
}

.nav-label {
  margin: 0 12px 7px;
  color: #4c4b47;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.nav-item {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  color: #777570;
  border: 1px solid transparent;
  border-radius: 13px;
  text-align: left;
  background: transparent;
  transition: 160ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -17px;
  width: 3px;
  border-radius: 3px;
  background: var(--gold);
  box-shadow: 0 0 15px var(--gold);
  opacity: 0;
  transition: 160ms ease;
}

.nav-item:hover {
  color: #d5d2ca;
  background: rgba(255, 255, 255, 0.025);
}

.nav-item.active {
  color: #fff8e6;
  border-color: rgba(224, 177, 66, 0.16);
  background: linear-gradient(90deg, rgba(224, 177, 66, 0.13), rgba(224, 177, 66, 0.025));
}

.nav-item.active::before {
  opacity: 1;
}

.nav-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-item.active .nav-icon {
  color: var(--gold-strong);
  border-color: rgba(224, 177, 66, 0.2);
  background: rgba(224, 177, 66, 0.1);
}

.nav-copy strong,
.nav-copy small {
  display: block;
}

.nav-copy strong {
  font-size: 0.82rem;
}

.nav-copy small {
  overflow: hidden;
  margin-top: 3px;
  color: #55534e;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-arrow {
  width: 15px;
  height: 15px;
  opacity: 0;
  transform: translateX(-4px);
  transition: 160ms ease;
}

.nav-item.active .nav-arrow {
  color: var(--gold);
  opacity: 1;
  transform: translateX(0);
}

.sidebar-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-top: auto;
  padding: 15px 7px 0;
  border-top: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #1a1305;
  border: 1px solid #e4ba55;
  border-radius: 12px;
  background: linear-gradient(135deg, #f2cd6a, #9f6a11);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(207, 147, 31, 0.15);
}

.sidebar-user-copy {
  min-width: 0;
}

.sidebar-user-copy strong,
.sidebar-user-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy strong {
  font-size: 0.77rem;
}

.sidebar-user-copy span {
  margin-top: 3px;
  color: #686660;
  font-size: 0.67rem;
}

.sidebar-user .icon-btn {
  width: 36px;
  height: 36px;
}

.sidebar-overlay {
  display: none;
}

.content {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(22px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 4, 4, 0.8);
  backdrop-filter: blur(22px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 14px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1;
}

.topbar-right {
  gap: 14px;
}

.clock-block,
.role-chip {
  padding: 0 16px;
  border-left: 1px solid var(--line);
}

.clock-block span,
.clock-block strong,
.role-chip span,
.role-chip strong {
  display: block;
}

.clock-block {
  min-width: 108px;
  text-align: right;
}

.clock-block span,
.role-chip span {
  color: #696761;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.clock-block strong {
  margin-top: 4px;
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.role-chip {
  max-width: 250px;
}

.role-chip strong {
  overflow: hidden;
  margin-top: 4px;
  color: var(--gold);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-btn {
  display: none;
}

.content-scroll {
  padding: clamp(22px, 3vw, 42px);
}

.page {
  display: none;
  animation: pageIn 260ms ease both;
}

.page.active {
  display: block;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

/* Dashboard */
.hero-command {
  display: grid;
  min-height: 310px;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  align-items: center;
  gap: 30px;
  overflow: hidden;
  padding: clamp(27px, 4vw, 48px);
  border-color: rgba(224, 177, 66, 0.17);
  background:
    linear-gradient(100deg, rgba(224, 177, 66, 0.065), transparent 50%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 35%),
    rgba(10, 10, 10, 0.91);
}

.hero-command::after {
  content: "";
  position: absolute;
  top: -70%;
  right: -13%;
  width: 500px;
  height: 500px;
  border: 1px solid rgba(224, 177, 66, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(224, 177, 66, 0.025), 0 0 0 140px rgba(224, 177, 66, 0.015);
}

.hero-command-copy {
  position: relative;
  z-index: 2;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 27px;
  padding: 7px 10px;
  color: #8d8a83;
  border: 1px solid rgba(91, 209, 155, 0.12);
  border-radius: 9px;
  background: rgba(91, 209, 155, 0.035);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.hero-command h2 {
  margin: 12px 0 18px;
  font-family: "Teko", sans-serif;
  font-size: clamp(3.3rem, 6vw, 5.5rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 0.82;
  text-transform: uppercase;
}

.hero-command h2 span {
  color: var(--gold-strong);
}

.hero-command-copy > p:not(.eyebrow) {
  max-width: 700px;
  margin: 0;
  color: #92908a;
  font-size: 0.93rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 27px;
}

.hero-emblem {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 260px;
}

.hero-emblem img {
  position: relative;
  z-index: 2;
  width: min(100%, 280px);
  filter: drop-shadow(0 25px 45px rgba(224, 177, 66, 0.18));
}

.emblem-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(224, 177, 66, 0.13);
  filter: blur(55px);
}

.emblem-data {
  position: absolute;
  right: 0;
  bottom: 8px;
  z-index: 3;
  padding: 10px 13px;
  border: 1px solid rgba(224, 177, 66, 0.16);
  border-radius: 10px;
  background: rgba(4, 4, 4, 0.82);
}

.emblem-data span,
.emblem-data strong {
  display: block;
  font-family: "Rajdhani", sans-serif;
}

.emblem-data span {
  color: #67655f;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
}

.emblem-data strong {
  margin-top: 2px;
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.stat-card {
  display: grid;
  min-height: 142px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 21px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.stat-card:hover {
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.14);
  background: var(--panel-hover);
  transform: translateY(-3px);
}

.stat-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(224, 177, 66, 0.16);
  border-radius: 13px;
  background: rgba(224, 177, 66, 0.07);
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-content {
  min-width: 0;
}

.stat-content > span,
.stat-content > strong,
.stat-content > small {
  display: block;
}

.stat-content > span {
  color: #7b7973;
  font-size: 0.7rem;
  font-weight: 600;
}

.stat-content > strong {
  overflow: hidden;
  margin: 6px 0;
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(1.65rem, 2.3vw, 2.25rem);
  letter-spacing: -0.02em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-content > small {
  color: #5d5b56;
  font-size: 0.64rem;
  white-space: nowrap;
}

.stat-content small i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--success);
}

.stat-gold {
  border-color: rgba(224, 177, 66, 0.22);
  background:
    linear-gradient(135deg, rgba(224, 177, 66, 0.1), transparent 58%),
    var(--panel);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.65fr);
  gap: 16px;
  margin-top: 16px;
}

.section-card {
  padding: 24px;
}

.section-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 21px;
}

.section-head h3 {
  margin: 6px 0 0;
  font-size: 1.15rem;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  color: #8b8983;
  border: 0;
  background: none;
  font-size: 0.86rem;
  font-weight: 700;
}

.text-btn:hover {
  color: var(--gold);
}

.text-btn svg {
  width: 15px;
  height: 15px;
}

.table-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #686660;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

td {
  color: #9d9b95;
  font-size: 0.76rem;
}

td strong {
  color: #e7e3da;
  font-weight: 700;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.022);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-row td {
  padding: 38px 16px;
  color: #66645e;
  text-align: center;
}

.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.badge::before,
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.badge.paid,
.badge.active,
.status-badge.online {
  color: var(--success);
  border-color: rgba(91, 209, 155, 0.14);
  background: rgba(91, 209, 155, 0.05);
}

.badge.suspended,
.badge.error {
  color: var(--danger);
  border-color: rgba(255, 110, 104, 0.16);
  background: rgba(255, 110, 104, 0.055);
}

.badge.review,
.badge.exempt {
  color: var(--gold);
  border-color: rgba(224, 177, 66, 0.18);
  background: rgba(224, 177, 66, 0.06);
}

.regulation-card {
  overflow: hidden;
  border-color: rgba(224, 177, 66, 0.16);
}

.regulation-card::after {
  content: "V4";
  position: absolute;
  right: -8px;
  bottom: -35px;
  color: rgba(224, 177, 66, 0.035);
  font-family: "Teko", sans-serif;
  font-size: 11rem;
  line-height: 1;
}

.regulation-visual {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  padding: 17px 0 22px;
  border-bottom: 1px solid var(--line);
}

.regulation-visual > span {
  color: var(--gold-strong);
  font-family: "Teko", sans-serif;
  font-size: 5.5rem;
  line-height: 0.7;
}

.regulation-visual > small {
  color: var(--gold);
  font-family: "Teko", sans-serif;
  font-size: 2.1rem;
}

.regulation-visual p {
  max-width: 140px;
  margin: 0 0 2px 15px;
  color: #77756f;
  font-size: 0.7rem;
  line-height: 1.45;
}

.rule-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.rule-list > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-list > div:last-child {
  border-bottom: 0;
}

.rule-list span {
  color: #77756f;
  font-size: 0.69rem;
}

.rule-list strong {
  color: #d8d4ca;
  font-size: 0.7rem;
  text-align: right;
}

/* Page headers */
.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 23px;
  padding: 4px 2px;
}

.page-intro h2 {
  margin: 8px 0 8px;
  font-size: clamp(1.75rem, 3.5vw, 2.55rem);
}

.page-intro p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.page-intro-code {
  min-width: 118px;
  padding: 11px 14px;
  border: 1px solid rgba(224, 177, 66, 0.16);
  border-radius: 11px;
  background: rgba(224, 177, 66, 0.045);
  text-align: right;
}

.page-intro-code span,
.page-intro-code strong {
  display: block;
  font-family: "Rajdhani", sans-serif;
}

.page-intro-code span {
  color: #68655f;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
}

.page-intro-code strong {
  margin-top: 3px;
  color: var(--gold);
  font-size: 1.08rem;
  letter-spacing: 0.07em;
}

/* Taxes */
.tax-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(350px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.tax-form-card,
.receipt-card {
  min-height: 590px;
}

.step-label {
  color: #66645f;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.two-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.money-input {
  position: relative;
}

.money-input > span {
  position: absolute;
  top: 50%;
  left: 15px;
  color: var(--gold);
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  transform: translateY(-50%);
}

.money-input input {
  padding-left: 35px;
}

.calculation-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-top: 4px;
  border: 1px solid rgba(224, 177, 66, 0.12);
  border-radius: 13px;
  background: rgba(224, 177, 66, 0.035);
}

.calculation-strip > div {
  padding: 16px;
  border-right: 1px solid rgba(224, 177, 66, 0.1);
}

.calculation-strip > div:last-child {
  border-right: 0;
}

.calculation-strip span,
.calculation-strip strong {
  display: block;
}

.calculation-strip span {
  color: #77746e;
  font-size: 0.63rem;
}

.calculation-strip strong {
  overflow: hidden;
  margin-top: 5px;
  color: #eee9de;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculation-strip > div:last-child strong {
  color: var(--gold-strong);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 5px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.receipt-card {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
}

.discord-preview {
  position: relative;
  z-index: 2;
  min-height: 330px;
  margin: 0;
  overflow: auto;
  padding: 21px;
  color: #d8d2c5;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(224, 177, 66, 0.025), transparent 40%),
    rgba(2, 2, 2, 0.7);
  font-family: "Rajdhani", monospace;
  font-size: 0.79rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.receipt-summary {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  padding: 17px 19px;
  border: 1px solid rgba(224, 177, 66, 0.2);
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(224, 177, 66, 0.1), rgba(224, 177, 66, 0.035));
}

.receipt-summary span {
  color: #8c8982;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.receipt-summary strong {
  color: var(--gold-strong);
  font-family: "Rajdhani", sans-serif;
  font-size: 1.45rem;
}

.send-status {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 12px 14px;
  color: #77746e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.022);
  font-size: 0.86rem;
}

.send-status.loading > span {
  background: var(--warning);
  box-shadow: 0 0 14px rgba(232, 183, 91, 0.7);
  animation: pulse 900ms ease infinite;
}

.send-status.ok {
  color: var(--success);
  border-color: rgba(91, 209, 155, 0.15);
  background: rgba(91, 209, 155, 0.045);
}

.send-status.error {
  color: var(--danger);
  border-color: rgba(255, 110, 104, 0.15);
  background: rgba(255, 110, 104, 0.045);
}

.send-status.error > span {
  background: var(--danger);
  box-shadow: 0 0 14px rgba(255, 110, 104, 0.7);
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

/* Activities */
.mini-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #6c6a64;
  font-size: 0.65rem;
}

.mini-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mini-legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.mini-legend .green { background: var(--success); }
.mini-legend .gold { background: var(--gold); }

.activity-grid,
.operator-grid {
  position: relative;
  z-index: 2;
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.activity-card,
.operator-card {
  position: relative;
  overflow: hidden;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.022);
}

.activity-card::after,
.operator-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: var(--success);
  opacity: 0.8;
}

.activity-card.exempt::after {
  background: var(--gold);
}

.activity-card-head,
.operator-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-card h4,
.operator-card h4 {
  margin: 0;
  font-size: 0.82rem;
}

.activity-card-meta,
.operator-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  color: #6e6c66;
  font-size: 0.66rem;
}

.activity-card-meta strong,
.operator-card-meta strong {
  color: #bbb7ae;
  font-weight: 600;
}

/* Archive */
.archive-toolbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px auto;
  gap: 10px;
  margin-bottom: 12px;
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #696761;
  transform: translateY(-50%);
}

.search-field input {
  padding-left: 42px;
}

.archive-summary {
  position: relative;
  z-index: 2;
  margin-bottom: 6px;
  color: #625f59;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-action {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #7a7771;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.table-action svg {
  width: 15px;
  height: 15px;
}

.table-action:hover {
  color: var(--danger);
  border-color: rgba(255, 110, 104, 0.22);
  background: rgba(255, 110, 104, 0.06);
}

/* Accounts */
.accounts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.55fr);
  gap: 16px;
  align-items: start;
}

.master-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  border-color: rgba(224, 177, 66, 0.18);
}

.master-panel-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.master-symbol {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(224, 177, 66, 0.17);
  border-radius: 13px;
  background: rgba(224, 177, 66, 0.075);
}

.master-symbol svg {
  width: 22px;
  height: 22px;
}

.master-panel h3 {
  margin: 5px 0 0;
}

.master-locked {
  display: grid;
  min-height: 430px;
  place-items: center;
  text-align: center;
}

.master-locked-inner {
  max-width: 280px;
}

.master-locked .master-symbol {
  margin: 0 auto 18px;
}

.master-locked h3 {
  margin: 8px 0 10px;
}

.master-locked p:last-child {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.6;
}

/* Modal + toast */
.modal-backdrop {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  visibility: hidden;
  opacity: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  transition: 180ms ease;
}

.modal-backdrop.open {
  visibility: visible;
  opacity: 1;
}

.confirm-modal {
  width: min(100%, 420px);
  padding: 30px;
  text-align: center;
  transform: translateY(10px) scale(0.98);
  transition: 180ms ease;
}

.modal-backdrop.open .confirm-modal {
  transform: none;
}

.modal-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin: 0 auto 18px;
  color: var(--danger);
  border: 1px solid rgba(255, 110, 104, 0.18);
  border-radius: 15px;
  background: rgba(255, 110, 104, 0.07);
}

.modal-icon svg {
  width: 23px;
  height: 23px;
}

.confirm-modal h3 {
  margin: 0 0 10px;
}

.confirm-modal p {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.6;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 25px;
}

.toast {
  position: fixed;
  z-index: 1400;
  right: 24px;
  bottom: 24px;
  max-width: min(390px, calc(100vw - 40px));
  padding: 14px 17px;
  color: #ece8de;
  border: 1px solid rgba(224, 177, 66, 0.2);
  border-radius: 12px;
  background: rgba(12, 12, 12, 0.96);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
  font-size: 0.88rem;
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: 190ms ease;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 1260px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-shell {
    grid-template-columns: minmax(0, 1fr) 430px;
  }

  .auth-brand-block {
    grid-template-columns: 230px 1fr;
  }

  .auth-copy h1 {
    font-size: 4.4rem;
  }

  .dashboard-grid,
  .tax-layout,
  .accounts-layout {
    grid-template-columns: 1fr;
  }

  .receipt-card,
  .master-panel {
    position: static;
  }

  .tax-form-card,
  .receipt-card {
    min-height: auto;
  }
}

@media (max-width: 1020px) {
  :root {
    --sidebar-width: 280px;
  }

  .app {
    display: block;
  }

  .content {
    grid-column: auto;
  }

  .sidebar {
    transform: translateX(-102%);
    transition: transform 220ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
    transition: 200ms ease;
  }

  .sidebar-overlay.show {
    visibility: visible;
    opacity: 1;
  }

  .menu-btn {
    display: inline-grid;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    display: none;
  }

  .auth-card-logo {
    display: block;
  }

  .auth-panel-wrap {
    background:
      radial-gradient(circle at 50% 25%, rgba(224, 177, 66, 0.1), transparent 32%),
      rgba(2, 2, 2, 0.65);
  }

  .hero-command {
    grid-template-columns: 1fr 240px;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 78px;
    --radius-lg: 16px;
  }

  .intro-footer span:not(:last-child) {
    display: none;
  }

  .intro-footer {
    justify-content: center;
  }

  .intro-emblem-wrap {
    width: 235px;
    height: 235px;
  }

  .intro-logo {
    width: 165px;
  }

  .topbar {
    min-height: var(--topbar-height);
    padding: 14px 17px;
  }

  .topbar-right .clock-block {
    display: none;
  }

  .role-chip {
    max-width: 150px;
    padding: 0 0 0 12px;
  }

  .role-chip strong {
    font-size: 0.86rem;
  }

  .content-scroll {
    padding: 17px;
  }

  .hero-command {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 26px 22px;
  }

  .hero-emblem {
    display: none;
  }

  .hero-status {
    margin-bottom: 20px;
  }

  .hero-command h2 {
    font-size: 3.6rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    min-height: 112px;
  }

  .dashboard-grid {
    gap: 10px;
  }

  .section-card {
    padding: 18px;
  }

  .section-head {
    align-items: flex-start;
    margin-bottom: 17px;
  }

  .page-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-intro-code {
    display: none;
  }

  .two-grid,
  .calculation-strip {
    grid-template-columns: 1fr;
  }

  .calculation-strip > div {
    border-right: 0;
    border-bottom: 1px solid rgba(224, 177, 66, 0.1);
  }

  .calculation-strip > div:last-child {
    border-bottom: 0;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .action-row .btn {
    width: 100%;
  }

  .discord-preview {
    min-height: 280px;
  }

  .archive-toolbar {
    grid-template-columns: 1fr;
  }

  .desktop-only-table {
    display: none;
  }

  .activity-grid,
  .operator-grid {
    display: grid;
  }

  .auth-panel-wrap {
    padding: 18px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .toast {
    right: 17px;
    bottom: 17px;
    left: 17px;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .activity-grid,
  .operator-grid {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 1.35rem;
  }

  .topbar .eyebrow {
    font-size: 0.62rem;
  }

  .role-chip span {
    display: none;
  }

  .role-chip strong {
    margin-top: 0;
  }

  .hero-actions {
    display: grid;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* NOW V4 · Archivio documenti e prenotazioni udienze */
button,
input,
select,
textarea {
  font: inherit;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  resize: vertical;
  color: #f5f2ea;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  outline: 0;
  background: rgba(2, 2, 2, 0.58);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

textarea::placeholder {
  color: #55534f;
}

textarea:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

textarea:focus {
  border-color: rgba(224, 177, 66, 0.55);
  background: rgba(5, 5, 5, 0.9);
  box-shadow: 0 0 0 4px rgba(224, 177, 66, 0.07);
}

.sidebar {
  overflow: hidden;
}

.nav {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.hero-actions {
  flex-wrap: wrap;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.document-builder {
  overflow: hidden;
  border-color: rgba(224, 177, 66, 0.16);
}

.document-builder::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 360px;
  height: 360px;
  opacity: 0.022;
  background: url("assets/now-v4-logo.png") center / contain no-repeat;
  filter: grayscale(1);
  pointer-events: none;
}

.document-builder form {
  position: relative;
  z-index: 2;
}

.document-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(160px, 0.55fr) minmax(200px, 0.7fr);
  gap: 14px;
}

.document-title-field {
  grid-column: span 1;
}

.document-collections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.collection-panel {
  min-height: 190px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background:
    linear-gradient(140deg, rgba(224, 177, 66, 0.035), transparent 42%),
    rgba(255, 255, 255, 0.018);
}

.collection-head,
.collection-head > div {
  display: flex;
  align-items: center;
}

.collection-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.collection-head > div {
  gap: 8px;
}

.collection-head svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.collection-head strong {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.collection-head > span {
  color: #65625d;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.collection-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
}

.collection-add-row input {
  min-height: 44px;
}

.add-collection-btn {
  width: 46px;
  height: 44px;
  color: var(--gold);
  border-color: rgba(224, 177, 66, 0.18);
  background: rgba(224, 177, 66, 0.065);
}

.chip-list,
.detail-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.collection-chip,
.detail-chip-list > span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 7px 9px;
  color: #d7d1c5;
  border: 1px solid rgba(224, 177, 66, 0.13);
  border-radius: 9px;
  background: rgba(224, 177, 66, 0.045);
  font-size: 0.69rem;
  line-height: 1.25;
}

.collection-chip > span {
  overflow-wrap: anywhere;
}

.collection-chip button {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  place-items: center;
  color: #77736c;
  border: 0;
  border-radius: 5px;
  background: transparent;
}

.collection-chip button:hover {
  color: var(--danger);
  background: rgba(255, 110, 104, 0.08);
}

.collection-chip button svg {
  width: 12px;
  height: 12px;
}

.collection-empty,
.detail-chip-list em {
  color: #5d5a54;
  font-size: 0.69rem;
  font-style: normal;
}

.document-actions {
  justify-content: space-between;
}

.document-archive-card,
.hearing-archive-card {
  margin-top: 16px;
}

.document-toolbar {
  grid-template-columns: minmax(300px, 1fr) 210px auto;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-action.view-action:hover {
  color: var(--gold);
  border-color: rgba(224, 177, 66, 0.22);
  background: rgba(224, 177, 66, 0.06);
}

.record-badge,
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 5px 8px;
  border: 1px solid currentColor;
  border-radius: 7px;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.record-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.status-open,
.status-scheduled {
  color: #e8b75b;
  background: rgba(232, 183, 91, 0.055);
}

.status-investigation,
.status-confirmed {
  color: #74b5ff;
  background: rgba(116, 181, 255, 0.055);
}

.status-hearing,
.status-in-progress {
  color: #d297ff;
  background: rgba(210, 151, 255, 0.055);
}

.status-closed,
.status-completed {
  color: var(--success);
  background: rgba(91, 209, 155, 0.055);
}

.status-archived {
  color: #9c9a95;
  background: rgba(156, 154, 149, 0.055);
}

.status-cancelled {
  color: var(--danger);
  background: rgba(255, 110, 104, 0.055);
}

.priority-badge {
  border-color: rgba(255, 255, 255, 0.08);
}

.priority-normal {
  color: #aaa7a0;
  background: rgba(255, 255, 255, 0.025);
}

.priority-high {
  color: var(--warning);
  border-color: rgba(232, 183, 91, 0.16);
  background: rgba(232, 183, 91, 0.055);
}

.priority-urgent {
  color: var(--danger);
  border-color: rgba(255, 110, 104, 0.18);
  background: rgba(255, 110, 104, 0.065);
}

.mobile-record-grid {
  display: none;
}

.mobile-record-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
}

.mobile-record-head,
.mobile-record-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mobile-record-head h4 {
  margin: 5px 0 0;
  font-size: 0.9rem;
}

.record-id {
  color: var(--gold);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.mobile-record-meta {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  color: #77746e;
  font-size: 0.8rem;
}

.mobile-record-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-record-meta svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.mobile-record-footer {
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.mobile-empty-state {
  padding: 30px 15px;
  color: #66635d;
  text-align: center;
  font-size: 0.75rem;
}

.three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.three-grid label {
  display: grid;
  gap: 8px;
  color: #c7c4bd;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.045em;
}

.hearing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.upcoming-hearings-card {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  min-height: 480px;
  overflow: hidden;
  border-color: rgba(224, 177, 66, 0.15);
}

.upcoming-hearings-card::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 330px;
  height: 330px;
  opacity: 0.025;
  background: url("assets/now-v4-logo.png") center / contain no-repeat;
  pointer-events: none;
}

.upcoming-hearings-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
}

.upcoming-hearing {
  display: grid;
  width: 100%;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  text-align: left;
  background: rgba(255, 255, 255, 0.022);
  transition: 160ms ease;
}

.upcoming-hearing:hover {
  border-color: rgba(224, 177, 66, 0.2);
  background: rgba(224, 177, 66, 0.045);
  transform: translateY(-1px);
}

.upcoming-date {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(224, 177, 66, 0.16);
  border-radius: 12px;
  background: rgba(224, 177, 66, 0.065);
}

.upcoming-date strong,
.upcoming-date small,
.upcoming-copy strong,
.upcoming-copy small {
  display: block;
}

.upcoming-date strong {
  color: var(--gold-strong);
  font-family: "Rajdhani", sans-serif;
  font-size: 1.15rem;
  line-height: 1;
}

.upcoming-date small {
  margin-top: 3px;
  color: #8c7952;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
}

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

.upcoming-copy strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-copy small {
  overflow: hidden;
  margin-top: 5px;
  color: #706d67;
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-status {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.upcoming-status .record-badge,
.upcoming-status .priority-badge {
  font-size: 0.55rem;
}

.upcoming-empty {
  display: grid;
  min-height: 320px;
  place-items: center;
  align-content: center;
  color: #66635d;
  text-align: center;
}

.upcoming-empty svg {
  width: 34px;
  height: 34px;
  margin-bottom: 13px;
  color: var(--gold);
}

.upcoming-empty strong,
.upcoming-empty span {
  display: block;
}

.upcoming-empty strong {
  color: #c5c0b5;
  font-size: 0.82rem;
}

.upcoming-empty span {
  margin-top: 6px;
  font-size: 0.69rem;
}

.hearing-toolbar {
  grid-template-columns: minmax(280px, 1fr) 190px 170px;
}

.table-subline {
  display: block;
  margin-top: 4px;
  color: #69665f;
  font-size: 0.62rem;
}

.record-modal {
  width: min(100%, 980px);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 28px;
  transform: translateY(12px) scale(0.985);
  transition: 180ms ease;
}

.modal-backdrop.open .record-modal {
  transform: none;
}

.record-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.record-modal-head h3 {
  margin: 6px 0 0;
  font-size: 1.45rem;
}

.record-modal-body {
  padding: 22px 0;
}

.record-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.record-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border: 1px solid rgba(224, 177, 66, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(120deg, rgba(224, 177, 66, 0.09), transparent 60%),
    rgba(255, 255, 255, 0.022);
}

.record-detail-hero h4 {
  margin: 7px 0 7px;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.record-detail-hero p {
  margin: 0;
  color: #7d7a73;
  font-size: 0.88rem;
}

.detail-badge-stack {
  display: grid;
  justify-items: end;
  gap: 9px;
}

.record-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.record-detail-grid > div,
.record-status-control {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.record-detail-grid span,
.record-description > span,
.record-detail-section-head > span {
  color: #706d66;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.record-detail-grid strong {
  color: #ded9cf;
  font-size: 0.77rem;
}

.record-detail-grid small {
  color: #5f5c56;
  font-size: 0.62rem;
  line-height: 1.4;
}

.record-status-control select {
  min-height: 42px;
  margin-top: 2px;
}

.record-description {
  margin-top: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(2, 2, 2, 0.42);
}

.record-description p {
  margin: 11px 0 0;
  color: #b4b0a7;
  font-size: 0.88rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.record-detail-collections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.record-detail-section {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
}

.record-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record-detail-section-head strong {
  display: grid;
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(224, 177, 66, 0.13);
  border-radius: 7px;
  background: rgba(224, 177, 66, 0.045);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.66rem;
}

.linked-document-button {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  margin-top: 12px;
  padding: 14px 16px;
  color: inherit;
  border: 1px solid rgba(224, 177, 66, 0.14);
  border-radius: 13px;
  text-align: left;
  background: rgba(224, 177, 66, 0.04);
}

.linked-document-button span,
.linked-document-button strong {
  display: block;
}

.linked-document-button span {
  color: #716d65;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.linked-document-button strong {
  grid-column: 1;
  color: #d9d2c4;
  font-size: 0.77rem;
}

.linked-document-button svg {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.linked-document-button:hover {
  border-color: rgba(224, 177, 66, 0.3);
  background: rgba(224, 177, 66, 0.07);
}

.linked-document-empty {
  margin-top: 12px;
  padding: 14px;
  color: #66635d;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-size: 0.7rem;
  text-align: center;
}

.record-audit {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 12px;
  padding: 12px 14px;
  color: #66635d;
  border-top: 1px solid var(--line);
  font-size: 0.66rem;
}

.record-audit strong {
  color: #aaa59b;
}

@media (max-width: 1260px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hearing-layout {
    grid-template-columns: 1fr;
  }

  .upcoming-hearings-card {
    position: static;
  }
}

@media (max-width: 900px) {
  .document-header-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-title-field {
    grid-column: 1 / -1;
  }

  .record-detail-grid,
  .hearing-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hearing-toolbar,
  .document-toolbar {
    grid-template-columns: 1fr 190px;
  }

  .hearing-toolbar input[type="date"],
  .document-toolbar .btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .document-header-grid,
  .document-collections-grid,
  .three-grid,
  .record-detail-grid,
  .record-detail-collections {
    grid-template-columns: 1fr;
  }

  .document-title-field {
    grid-column: auto;
  }

  .document-toolbar,
  .hearing-toolbar {
    grid-template-columns: 1fr;
  }

  .hearing-toolbar input[type="date"],
  .document-toolbar .btn {
    grid-column: auto;
  }

  .document-archive-card .table-wrap,
  .hearing-archive-card .table-wrap {
    display: none;
  }

  .mobile-record-grid {
    display: grid;
    gap: 10px;
  }

  .record-modal {
    max-height: calc(100vh - 24px);
    padding: 20px 17px;
  }

  .record-detail-hero {
    flex-direction: column;
  }

  .detail-badge-stack {
    justify-items: start;
  }

  .record-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .record-modal-actions .btn {
    width: 100%;
  }

  .upcoming-hearing {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .upcoming-status {
    grid-column: 2;
    grid-row: 2;
    justify-items: start;
    grid-auto-flow: column;
  }

  .record-audit {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .document-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .document-actions .btn {
    width: 100%;
  }

  .mobile-record-head {
    flex-direction: column;
  }

  .mobile-record-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ===== NOW V4 · Calendario udienze mensile ===== */
.section-head-actions,
.calendar-page-actions,
.calendar-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.calendar-page-intro {
  align-items: flex-end;
}

.calendar-page-actions {
  justify-content: flex-end;
}

.calendar-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.calendar-stat {
  position: relative;
  min-height: 122px;
  padding: 20px 22px;
  overflow: hidden;
}

.calendar-stat::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -48px;
  width: 130px;
  height: 130px;
  opacity: 0.025;
  background: url("assets/now-v4-logo.png") center / contain no-repeat;
  pointer-events: none;
}

.calendar-stat span,
.calendar-stat strong,
.calendar-stat small {
  position: relative;
  z-index: 1;
  display: block;
}

.calendar-stat span {
  color: #8e8a82;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-stat strong {
  margin-top: 7px;
  color: var(--gold-strong);
  font-family: "Rajdhani", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.calendar-stat small {
  margin-top: 8px;
  color: #65625c;
  font-size: 0.64rem;
}

.court-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.34fr);
  gap: 16px;
  align-items: start;
}

.court-calendar-card {
  min-width: 0;
  overflow: hidden;
}

.court-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.calendar-month-heading h3 {
  margin: 5px 0 0;
  font-size: 1.35rem;
  text-transform: capitalize;
}

.calendar-nav-btn {
  width: 39px;
  height: 39px;
  border-color: rgba(224, 177, 66, 0.16);
  background: rgba(224, 177, 66, 0.04);
}

.calendar-nav-btn svg {
  transform: rotate(180deg);
}

.calendar-nav-btn.next svg {
  transform: none;
}

.calendar-filter-row {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 190px auto;
  gap: 10px;
  margin: 16px 0;
}

.calendar-filter-row select,
.calendar-filter-row .btn {
  min-height: 44px;
}

.court-calendar {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.16);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border-bottom: 1px solid rgba(224, 177, 66, 0.13);
  background: linear-gradient(180deg, rgba(224, 177, 66, 0.07), rgba(224, 177, 66, 0.025));
}

.calendar-weekdays span {
  padding: 12px 6px;
  color: #9c8b65;
  border-right: 1px solid rgba(255, 255, 255, 0.045);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-align: center;
  text-transform: uppercase;
}

.calendar-weekdays span:last-child {
  border-right: 0;
}

.calendar-cell {
  position: relative;
  min-width: 0;
  min-height: 188px;
  padding: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.047);
  border-bottom: 1px solid rgba(255, 255, 255, 0.047);
  background: rgba(255, 255, 255, 0.012);
  transition: 160ms ease;
}

.calendar-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-cell:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.calendar-cell:hover {
  background: rgba(224, 177, 66, 0.024);
}

.calendar-cell.outside-month {
  background: rgba(0, 0, 0, 0.16);
}

.calendar-cell.outside-month .calendar-date-button,
.calendar-cell.outside-month .calendar-cell-events {
  opacity: 0.4;
}

.calendar-cell.is-selected {
  background: linear-gradient(145deg, rgba(224, 177, 66, 0.095), rgba(224, 177, 66, 0.018));
  box-shadow: inset 0 0 0 1px rgba(224, 177, 66, 0.25);
}

.calendar-date-button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 0 2px 10px;
  color: #aaa69d;
  text-align: left;
}

.calendar-date-button span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
}

.calendar-date-button small {
  color: var(--gold);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.calendar-cell.is-today .calendar-date-button span {
  color: #100d07;
  background: linear-gradient(135deg, var(--gold-strong), #a87518);
  box-shadow: 0 5px 18px rgba(224, 177, 66, 0.18);
}

.calendar-cell-events {
  display: grid;
  gap: 9px;
}

.calendar-event,
.calendar-more {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: #bbb7ae;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-left-width: 4px;
  border-radius: 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
  transition: 150ms ease;
}

.calendar-event {
  display: flex;
  min-height: 76px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 10px 11px;
}

.calendar-more {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 11px;
  font-size: 0.82rem;
  font-weight: 700;
}

.calendar-event:hover,
.calendar-more:hover {
  border-color: rgba(224, 177, 66, 0.22);
  background: rgba(224, 177, 66, 0.07);
  transform: translateY(-1px);
}

.calendar-event time {
  color: #d4ab57;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
}

.calendar-event span {
  display: -webkit-box;
  overflow: hidden;
  color: #e9e3d6;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.14;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.calendar-event-scheduled {
  border-left-color: #9a8f79;
}

.calendar-event-confirmed {
  border-left-color: #63a978;
}

.calendar-event-in-progress {
  border-left-color: #dc9a37;
}

.calendar-event-completed {
  border-left-color: #668faf;
}

.calendar-event-cancelled {
  border-left-color: #a95353;
  opacity: 0.68;
}

.calendar-more {
  display: block;
  padding: 4px 7px;
  color: #8b7851;
  border: 0;
  background: transparent;
  font-size: 0.56rem;
  font-weight: 700;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  color: #77736b;
  font-size: 0.6rem;
}

.calendar-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9a8f79;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.08);
}

.calendar-legend i.confirmed { background: #63a978; }
.calendar-legend i.in-progress { background: #dc9a37; }
.calendar-legend i.completed { background: #668faf; }
.calendar-legend i.cancelled { background: #a95353; }

.calendar-day-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  min-height: 545px;
  overflow: hidden;
  border-color: rgba(224, 177, 66, 0.14);
}

.calendar-day-panel::after {
  content: "";
  position: absolute;
  right: -85px;
  bottom: -105px;
  width: 285px;
  height: 285px;
  opacity: 0.022;
  background: url("assets/now-v4-logo.png") center / contain no-repeat;
  pointer-events: none;
}

.calendar-day-head,
.calendar-day-hint,
.calendar-day-list {
  position: relative;
  z-index: 1;
}

.calendar-day-head h3 {
  text-transform: capitalize;
}

.calendar-day-count {
  display: grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  color: var(--gold-strong);
  border: 1px solid rgba(224, 177, 66, 0.17);
  border-radius: 12px;
  background: rgba(224, 177, 66, 0.055);
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.calendar-day-hint {
  margin: -3px 0 15px;
  color: #67645e;
  font-size: 0.65rem;
}

.calendar-day-list {
  display: grid;
  gap: 8px;
}

.calendar-day-hearing {
  display: grid;
  width: 100%;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-left-width: 3px;
  border-radius: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.022);
  transition: 160ms ease;
}

.calendar-day-hearing:hover {
  border-color: rgba(224, 177, 66, 0.22);
  background: rgba(224, 177, 66, 0.055);
  transform: translateY(-1px);
}

.calendar-day-time {
  color: var(--gold-strong);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
}

.calendar-day-time small {
  display: block;
  margin-top: 2px;
  color: #6f6b63;
  font-size: 0.57rem;
}

.calendar-day-copy {
  min-width: 0;
}

.calendar-day-copy strong,
.calendar-day-copy small,
.calendar-day-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-copy strong {
  color: #cbc6bb;
  font-size: 0.86rem;
}

.calendar-day-copy small {
  margin-top: 4px;
  color: #706d66;
  font-size: 0.6rem;
}

.calendar-day-copy em {
  margin-top: 5px;
  color: #8f7950;
  font-size: 0.55rem;
  font-style: normal;
  font-weight: 700;
}

.calendar-day-badges {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.calendar-day-badges .record-badge,
.calendar-day-badges .priority-badge {
  font-size: 0.5rem;
}

.calendar-day-empty {
  display: grid;
  min-height: 370px;
  place-items: center;
  align-content: center;
  padding: 30px 15px;
  color: #66635d;
  text-align: center;
}

.calendar-day-empty svg {
  width: 36px;
  height: 36px;
  margin-bottom: 13px;
  color: var(--gold);
}

.calendar-day-empty strong {
  color: #bbb6aa;
  font-size: 0.82rem;
}

.calendar-day-empty span {
  max-width: 240px;
  margin: 7px 0 16px;
  font-size: 0.66rem;
  line-height: 1.5;
}

@media (max-width: 1320px) {
  .court-calendar-layout {
    grid-template-columns: 1fr;
  }

  .calendar-day-panel {
    position: static;
    min-height: 0;
  }

  .calendar-day-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-day-empty {
    grid-column: 1 / -1;
    min-height: 230px;
  }
}

@media (max-width: 900px) {
  .calendar-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .calendar-filter-row {
    grid-template-columns: 1fr 180px;
  }

  .calendar-filter-row .btn {
    grid-column: 1 / -1;
  }

  .calendar-cell {
    min-height: 162px;
    padding: 8px;
  }

  .calendar-event {
    min-height: 62px;
    padding: 9px 10px;
  }

  .calendar-event time {
    font-size: 0.8rem;
  }

  .calendar-event span {
    font-size: 0.82rem;
  }
}

@media (max-width: 760px) {
  .calendar-page-intro {
    align-items: flex-start;
  }

  .calendar-page-actions,
  .section-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .calendar-page-actions .btn,
  .section-head-actions .btn {
    flex: 1 1 auto;
  }

  .calendar-stat-grid {
    grid-template-columns: 1fr;
  }

  .calendar-stat {
    min-height: 105px;
  }

  .court-calendar-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-controls {
    width: 100%;
    justify-content: space-between;
  }

  .calendar-compact-today {
    flex: 1;
  }

  .calendar-filter-row {
    grid-template-columns: 1fr;
  }

  .calendar-filter-row .btn {
    grid-column: auto;
  }

  .court-calendar {
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 980px;
  }

  .calendar-day-list {
    grid-template-columns: 1fr;
  }

  .calendar-day-hearing {
    grid-template-columns: 45px minmax(0, 1fr);
  }

  .calendar-day-badges {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .calendar-date-button span {
    width: 34px;
    height: 34px;
    font-size: 0.92rem;
  }

  .calendar-cell-events {
    gap: 10px;
  }
}

/* ===================================================================
   NOW V4 · Dashboard + ruoli per dipartimento + webhook manager
   =================================================================== */
:root {
  --v4-gov: #d9a33e;
  --v4-court: #a58ced;
  --v4-prosecution: #39cba8;
}

.webhook-manager { margin-top: 22px; overflow: hidden; }
.webhook-manager-heading { align-items: flex-start; gap: 24px; }
.webhook-manager-heading .panel-description { max-width: 790px; margin-top: 8px; line-height: 1.55; }
.webhook-admin-tag { display: inline-flex; gap: 8px; align-items: center; flex-shrink: 0; padding: 10px 13px; border: 1px solid rgba(224,177,66,.23); border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--gold-strong); background: rgba(224,177,66,.08); }
.webhook-admin-tag svg { width: 16px; height: 16px; }
.webhook-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0; }
.webhook-toolbar .search-field { width: min(100%, 540px); min-width: 0; }
.webhook-count { padding: 9px 13px; color: var(--muted); font-size: .78rem; white-space: nowrap; border: 1px solid var(--line); border-radius: 12px; }
.webhook-help { display: flex; align-items: flex-start; gap: 13px; background: rgba(224,177,66,.07); border: 1px solid rgba(224,177,66,.17); border-radius: 14px; padding: 14px 16px; margin-bottom: 20px; }
.webhook-help svg { color: var(--gold); width: 20px; height: 20px; flex-shrink: 0; }
.webhook-help p { margin: 0; color: #bfb7a2; line-height: 1.6; font-size: .84rem; }
.webhook-rows { display: grid; gap: 12px; }
.webhook-row { display: grid; grid-template-columns: minmax(200px, .9fr) minmax(270px, 1.3fr); gap: 22px; align-items: center; background: linear-gradient(120deg, rgba(255,255,255,.037), rgba(255,255,255,.013)); border: 1px solid rgba(255,255,255,.07); border-radius: 16px; padding: 19px 20px; transition: border-color .2s ease, background .2s ease; }
.webhook-row:hover, .webhook-row:focus-within { border-color: rgba(224,177,66,.33); background: linear-gradient(120deg, rgba(224,177,66,.055), rgba(255,255,255,.02)); }
.webhook-title { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; }
.webhook-title strong { font-size: .96rem; color: #fff; }
.webhook-row-info { min-width: 0; }
.webhook-subtitle { margin-top: 9px; color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.webhook-row-info small { display: block; margin-top: 7px; color: var(--muted-2); font-size: .72rem; }
.webhook-input-group { min-width: 0; }
.webhook-input-group label { display: block; color: var(--muted); font-size: .75rem; margin-bottom: 7px; }
.webhook-url-input { width: 100%; min-width: 0; height: 43px; padding: 0 13px; background: rgba(0,0,0,.38); border: 1px solid rgba(255,255,255,.15); border-radius: 10px; color: #fff; outline: none; transition: border-color .2s ease; }
.webhook-url-input:focus { border-color: var(--gold); }
.webhook-url-input::placeholder { color: #7d7970; }
.webhook-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.webhook-buttons .btn { min-height: 35px; padding: 8px 13px; border-radius: 9px; font-size: .76rem; }
.webhook-buttons .btn svg { width: 14px; height: 14px; }
.webhook-buttons .btn:disabled { opacity: .42; cursor: not-allowed; }
.webhook-empty { text-align: center; color: var(--muted); padding: 20px; }

.role-groups-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 23px; }
.role-department { position: relative; min-width: 0; padding: 20px; background: rgba(20,20,20,.8); border: 1px solid var(--line); border-radius: 16px; }
.role-department:before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 2px; opacity: .75; background: var(--v4-gov); border-radius: 5px; }
.role-department.tribunale:before { background: var(--v4-court); }
.role-department.procura:before { background: var(--v4-prosecution); }
.role-department-header { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; }
.role-department-header span { font-size: 1.14rem; }
.role-department-header strong { font-size: .95rem; }
.role-department-header small { margin-left: auto; color: var(--muted); font-size: .7rem; }
.role-department-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.role-department-tags span { padding: 5px 7px; line-height: 1.35; color: #c9c7c3; background: rgba(255,255,255,.055); border-radius: 7px; font-size: .72rem; }
.role-badge { white-space: normal; display: inline-flex; line-height: 1.4; max-width: 240px; }
.role-badge.role-governo { color: #f6cd78; border-color: rgba(225,173,60,.32); background: rgba(225,173,60,.09); }
.role-badge.role-tribunale { color: #c5b6fa; border-color: rgba(165,140,237,.32); background: rgba(165,140,237,.09); }
.role-badge.role-procura { color: #7bf3cc; border-color: rgba(57,203,168,.32); background: rgba(57,203,168,.09); }
.role-badge.role-master { color: #ffdb80; border-color: rgba(224,177,66,.5); background: rgba(224,177,66,.15); }
.role-badge.role-legacy { color: #c2c2c2; border-color: rgba(180,180,180,.2); background: rgba(180,180,180,.06); }
.table-actions, .operator-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; }
.table-actions .table-action:not(:has(svg)), .operator-actions .table-action:not(:has(svg)) { padding: 7px 10px; width: auto; height: auto; border-radius: 9px; font-size: .72rem; white-space: nowrap; }
.role-edit-form { display: grid; gap: 13px; }
.role-edit-form p { color: var(--muted); font-size: .85rem; line-height: 1.65; }
.role-edit-form label { font-size: .83rem; font-weight: 600; }
.role-edit-form select { width: 100%; min-height: 49px; background: #191715; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; padding: 0 13px; color: var(--text); }
.role-edit-form select optgroup { color: #e5b74e; }

@media (max-width: 1150px) {
  .role-groups-panel { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .webhook-row { grid-template-columns: 1fr; gap: 15px; }
}
@media (max-width: 720px) {
  .webhook-manager-heading { flex-direction: column; }
  .webhook-toolbar { flex-direction: column; align-items: stretch; }
  .webhook-count { align-self: flex-start; }
  .webhook-row { padding: 14px; }
  .webhook-buttons .btn { flex: 1 1 auto; justify-content: center; }
  .role-groups-panel { grid-template-columns: 1fr; }
  .table-actions { justify-content: flex-start; }
}
