/* =========================================================
   Alva – MarauderLabs UI Core v2.0 — Full Cyberpunk Lite
   Dark-first (výchozí) + Light Mode přepínač · Cyan + Magenta + Violet
   ========================================================= */

/* ---------- TOKENS / THEME (DARK DEFAULT - MARAUDERLABS) -- */
:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces */
  --ml-bg-0: #090B11; /* základ (ink) */
  --ml-bg-1: #0D1018; /* sekundární plochy */
  --ml-panel: #11162A; /* panely / karty */
  --ml-panel-grad-1: rgba(124, 92, 255, 0.08);
  --ml-panel-grad-2: rgba(124, 92, 255, 0.02);
  --ml-nav-bg: rgba(9, 11, 17, 0.75);
  --ml-input-bg: #0D1018;
  --ml-table-head: rgba(9, 11, 17, 0.7);
  --ml-row-hover: rgba(124, 92, 255, 0.09);

  /* Neon */
  --ml-cyan: #00E5FF;
  --ml-cyan-2: #6EE1FF;
  --ml-magenta: #FF3DF0;
  --ml-violet: #7C5CFF;

  /* Text & lines */
  --ml-txt: #E9EEFF;
  --ml-txt-2: #A2ABC7;
  --ml-line: rgba(124, 92, 255, 0.26);

  /* Radii / shadows */
  --ml-r-1: 14px;
  --ml-r-2: 18px;
  --ml-sh-neon:
    0 0 22px rgba(0, 229, 255, 0.20),
    0 0 60px rgba(255, 61, 240, 0.12);

  /* Layout */
  --ml-maxw: 1220px;
  --ml-gap: clamp(16px, 2.2vw, 26px);
  --ml-nav-h: 68px;

  /* Motion */
  --ml-speed-1: .24s;
  --ml-speed-2: .45s;
  --ml-ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- LIGHT THEME OVERRIDES ------------------------- */
[data-theme="light"] {
  color-scheme: light;

  --ml-bg-0: #F3F6FC;
  --ml-bg-1: #E8EEF9;
  --ml-panel: #FFFFFF;
  --ml-panel-grad-1: rgba(124, 92, 255, 0.05);
  --ml-panel-grad-2: rgba(0, 229, 255, 0.02);
  --ml-nav-bg: rgba(255, 255, 255, 0.86);
  --ml-input-bg: #F8FAFF;
  --ml-table-head: #EEF2FB;
  --ml-row-hover: rgba(124, 92, 255, 0.06);

  --ml-cyan: #0095B6;
  --ml-cyan-2: #00B8D9;
  --ml-magenta: #D61F9A;
  --ml-violet: #6344F5;

  --ml-txt: #0F172A;
  --ml-txt-2: #475569;
  --ml-line: rgba(99, 68, 245, 0.22);

  --ml-sh-neon:
    0 6px 24px rgba(15, 23, 42, 0.07),
    0 0 20px rgba(0, 184, 217, 0.10);
}

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

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

/* === JEDNOTNÉ POZADÍ PRO CELOU STRÁNKU ===================== */
body {
  margin: 0;
  color: var(--ml-txt);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;

  background-color: var(--ml-bg-0);
  background-image:
    radial-gradient(80vw 50vh at 80% 100%, rgba(255, 61, 240, .18) 0%, rgba(255, 61, 240, 0) 65%),
    radial-gradient(80vw 50vh at 20% 100%, rgba(0, 229, 255, .22) 0%, rgba(0, 229, 255, 0) 65%),
    radial-gradient(88vw 56vh at 16% 0%,  rgba(0, 229, 255, .28) 0%, rgba(0, 229, 255, 0) 66%),
    radial-gradient(88vw 56vh at 84% 0%,  rgba(255, 61, 240, .24) 0%, rgba(255, 61, 240, 0) 66%),
    linear-gradient(180deg, rgba(255, 255, 255, .02) 0%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, .02) 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover, cover, cover, cover, 100% 100%;

  padding-top: var(--ml-nav-h);
  overflow-x: hidden;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(80vw 50vh at 80% 100%, rgba(255, 61, 240, .08) 0%, rgba(255, 61, 240, 0) 65%),
    radial-gradient(80vw 50vh at 20% 100%, rgba(0, 229, 255, .11) 0%, rgba(0, 229, 255, 0) 65%),
    radial-gradient(88vw 56vh at 16% 0%,  rgba(0, 229, 255, .12) 0%, rgba(0, 229, 255, 0) 66%),
    radial-gradient(88vw 56vh at 84% 0%,  rgba(124, 92, 255, .10) 0%, rgba(124, 92, 255, 0) 66%);
}

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

a {
  color: var(--ml-cyan);
  text-decoration: none;
  transition: color var(--ml-speed-1) var(--ml-ease), text-shadow var(--ml-speed-1) var(--ml-ease);
}

a:hover {
  color: #C9F7FF;
  text-shadow: 0 0 10px rgba(0, 229, 255, .6);
}

[data-theme="light"] a:hover {
  color: var(--ml-violet);
  text-shadow: none;
}

:focus-visible {
  outline: 2px solid var(--ml-magenta);
  outline-offset: 2px;
}

/* ---------- TYPOGRAPHY & UTILITIES ------------------------ */
.ml-display, .ml-h2, .ml-brand-text, .card-title {
  font-family: "Oxanium", system-ui, sans-serif;
  letter-spacing: .35px;
}

.neon-cyan { color: var(--ml-cyan); text-shadow: 0 0 14px rgba(0, 229, 255, .6); }
.neon-magenta { color: var(--ml-magenta); text-shadow: 0 0 14px rgba(255, 61, 240, .6); }
.neon-violet { color: var(--ml-violet); text-shadow: 0 0 12px rgba(124, 92, 255, .45); }

.border-gradient {
  position: relative;
  border-radius: var(--ml-r-2);
  isolation: isolate;
}
.border-gradient::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  z-index: -1;
  background: linear-gradient(135deg, var(--ml-cyan), var(--ml-magenta));
  filter: blur(8px);
  opacity: .55;
}

/* ---------- NAVBAR (značka + logo Alva vlevo, menu vpravo) -- */
.ml-navbar,
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  background: var(--ml-nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ml-line);
}

.ml-navwrap,
.topbar-inner {
  width: min(100% - 32px, var(--ml-maxw));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  min-height: var(--ml-nav-h);
}

/* Značka s logem Alva */
.ml-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ml-txt);
  text-decoration: none;
}

.ml-brand:hover,
.brand:hover {
  color: var(--ml-cyan);
  text-shadow: 0 0 12px rgba(0, 229, 255, .5);
}

.ml-brand-text {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--ml-txt), var(--ml-cyan-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .ml-brand-text {
  background: linear-gradient(90deg, #0F172A, var(--ml-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ml-brand-sub {
  font-size: 0.85rem;
  color: var(--ml-txt-2);
  font-weight: 500;
  padding-left: 10px;
  border-left: 1px solid var(--ml-line);
}

/* Logo wrapper s MarauderLabs neon aurou */
.ml-product-logo-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: inline-block;
  isolation: isolate;
}

.ml-product-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  filter: none;
  transform: none;
}

.ml-product-logo-wrap::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 12px;
  pointer-events: none;
  background:
    radial-gradient(45% 45% at 35% 35%, rgba(0, 229, 255, .38), transparent 70%),
    radial-gradient(45% 45% at 65% 65%, rgba(255, 61, 240, .34), transparent 72%);
  filter: blur(7px);
  opacity: .85;
  z-index: -1;
}

/* Menu vpravo */
.ml-nav,
.topbar-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar-nav a:not(.btn) {
  color: var(--ml-txt);
  opacity: .92;
  padding: 7px 11px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
}

.topbar-nav a:not(.btn):hover {
  color: var(--ml-cyan);
  background: rgba(124, 92, 255, .10);
}

.tech-pill {
  background: rgba(124, 92, 255, .12);
  border: 1px solid var(--ml-line);
  color: var(--ml-txt);
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: inset 0 0 14px rgba(0, 229, 255, .10);
}

/* Přepínač Tmavý / Světlý režim */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124, 92, 255, .10);
  color: var(--ml-txt);
  border: 1px solid var(--ml-line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--ml-speed-1) var(--ml-ease), box-shadow var(--ml-speed-1) var(--ml-ease), transform var(--ml-speed-1) var(--ml-ease);
}

.theme-toggle:hover {
  border-color: var(--ml-cyan);
  box-shadow: 0 0 14px rgba(0, 229, 255, .30);
  transform: translateY(-1px);
}

/* ---------- CONTAINERS ------------------------------------ */
.ml-container,
.container {
  width: min(100% - 32px, var(--ml-maxw));
  margin: 1.75rem auto;
}

.container-narrow {
  width: min(100% - 32px, 760px);
  margin: 1.75rem auto;
}

.container-auth {
  width: min(100% - 32px, 460px);
  margin: 3.2rem auto;
}

/* ---------- PANELS / CARDS (.ml-panel / .ml-card) ---------- */
.ml-panel,
.ml-card,
.card {
  position: relative;
  background: linear-gradient(180deg, var(--ml-panel-grad-1), var(--ml-panel-grad-2)), var(--ml-panel);
  border: 1px solid var(--ml-line);
  border-radius: var(--ml-r-1);
  padding: clamp(18px, 3vw, 26px);
  box-shadow: var(--ml-sh-neon);
  margin-bottom: 1.35rem;
  transition: transform var(--ml-speed-2) var(--ml-ease), box-shadow var(--ml-speed-2) var(--ml-ease), border-color var(--ml-speed-2) var(--ml-ease);
}

.card:hover {
  border-color: rgba(0, 229, 255, .50);
  box-shadow:
    0 0 18px rgba(0, 229, 255, .20),
    0 0 46px rgba(255, 61, 240, .12);
}

.card-highlight {
  border-color: rgba(0, 229, 255, .65);
  box-shadow:
    0 0 24px rgba(0, 229, 255, .28),
    0 0 54px rgba(255, 61, 240, .16);
}

.card-header {
  margin-bottom: 1.2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--ml-line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--ml-txt);
  text-shadow: 0 0 14px rgba(124, 92, 255, .30);
}

.card-subtitle {
  margin: 0.28rem 0 0;
  color: var(--ml-txt-2);
  font-size: 0.92rem;
}

/* ---------- ALERTS / FLASH MESSAGES ----------------------- */
.alert {
  padding: 0.95rem 1.2rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--ml-line);
}

.alert-success {
  background: rgba(0, 229, 255, .10);
  color: var(--ml-txt);
  border-color: rgba(0, 229, 255, .60);
  box-shadow: 0 0 18px rgba(0, 229, 255, .20);
}

.alert-error {
  background: rgba(255, 61, 240, .12);
  color: var(--ml-txt);
  border-color: rgba(255, 61, 240, .65);
  box-shadow: 0 0 18px rgba(255, 61, 240, .22);
}

.alert-info {
  background: rgba(124, 92, 255, .14);
  color: var(--ml-txt);
  border-color: rgba(124, 92, 255, .55);
}

/* ---------- FORMS ----------------------------------------- */
.form-group {
  margin-bottom: 1.15rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.38rem;
  color: var(--ml-txt);
}

.label-hint {
  font-weight: 400;
  color: var(--ml-txt-2);
  font-size: 0.84rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.72rem 0.9rem;
  font-size: 0.96rem;
  font-family: inherit;
  color: var(--ml-txt);
  background-color: var(--ml-input-bg);
  border: 1px solid var(--ml-line);
  border-radius: 12px;
  transition: border-color var(--ml-speed-1) var(--ml-ease), box-shadow var(--ml-speed-1) var(--ml-ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--ml-txt-2);
  opacity: 0.6;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ml-cyan);
  box-shadow: 0 0 16px rgba(0, 229, 255, .35);
}

.pin-input {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  font-weight: 800;
  color: var(--ml-cyan);
}

textarea {
  resize: vertical;
  min-height: 115px;
}

/* ---------- BUTTONS (MarauderLabs .ml-btn & .ml-btn--ghost) */
.ml-btn,
.btn {
  --bg: linear-gradient(90deg, var(--ml-cyan), var(--ml-cyan-2));
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .78rem 1.1rem;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.94rem;
  font-family: inherit;
  letter-spacing: .3px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid rgba(0, 229, 255, .6);
  color: #001016;
  background: var(--bg);
  box-shadow: 0 0 14px rgba(0, 229, 255, .45);
  transition: transform var(--ml-speed-1) var(--ml-ease), box-shadow var(--ml-speed-1) var(--ml-ease), filter var(--ml-speed-1) var(--ml-ease), background var(--ml-speed-1) var(--ml-ease);
}

.ml-btn:hover,
.btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 0 24px rgba(0, 229, 255, .65);
  transform: translateY(-1px);
  color: #001016;
  text-shadow: none;
}

.btn-primary {
  --bg: linear-gradient(90deg, var(--ml-cyan), var(--ml-cyan-2));
  color: #001016;
}

.btn-success {
  --bg: linear-gradient(90deg, var(--ml-cyan), var(--ml-magenta));
  border-color: rgba(255, 61, 240, .6);
  color: #001016;
  box-shadow:
    0 0 16px rgba(0, 229, 255, .35),
    0 0 24px rgba(255, 61, 240, .25);
}

.ml-btn--ghost,
.btn-outline {
  color: var(--ml-txt);
  background: transparent;
  border: 1px solid rgba(255, 61, 240, .55);
  box-shadow: inset 0 0 18px rgba(255, 61, 240, .12);
}

.ml-btn--ghost:hover,
.btn-outline:hover {
  color: #140013;
  background: var(--ml-magenta);
  border-color: var(--ml-magenta);
  box-shadow: 0 0 22px rgba(255, 61, 240, .55);
  text-shadow: none;
}

.btn-sm {
  padding: .42rem .8rem;
  font-size: 0.83rem;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

/* ---------- BADGES (.ml-badge / .ml-saving variants) ------- */
.ml-badge,
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: .78rem;
  white-space: nowrap;
}

.badge-new {
  border: 1px solid rgba(0, 229, 255, .55);
  color: var(--ml-cyan);
  background: rgba(0, 229, 255, .10);
  box-shadow: inset 0 0 14px rgba(0, 229, 255, .14);
}

.badge-progress {
  border: 1px solid rgba(124, 92, 255, .60);
  color: #B4A0FF;
  background: rgba(124, 92, 255, .14);
  box-shadow: inset 0 0 14px rgba(124, 92, 255, .18);
}

[data-theme="light"] .badge-progress {
  color: var(--ml-violet);
}

.badge-resolved {
  border: 1px solid rgba(16, 185, 129, .55);
  color: #34D399;
  background: rgba(16, 185, 129, .12);
}

[data-theme="light"] .badge-resolved {
  color: #059669;
}

.badge-urgent {
  border: 1px solid rgba(255, 61, 240, .65);
  color: var(--ml-magenta);
  background: rgba(255, 61, 240, .12);
  box-shadow: inset 0 0 16px rgba(255, 61, 240, .18), 0 0 12px rgba(255, 61, 240, .25);
}

.badge-normal {
  border: 1px solid var(--ml-line);
  color: var(--ml-txt-2);
  background: rgba(124, 92, 255, .05);
}

/* ---------- STATS & FILTER BAR ----------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--ml-gap);
  margin-bottom: 1.35rem;
}

.stat-box {
  background: linear-gradient(180deg, var(--ml-panel-grad-1), var(--ml-panel-grad-2)), var(--ml-panel);
  border: 1px solid var(--ml-line);
  border-radius: var(--ml-r-1);
  box-shadow: var(--ml-sh-neon);
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform var(--ml-speed-2) var(--ml-ease), border-color var(--ml-speed-2) var(--ml-ease), box-shadow var(--ml-speed-2) var(--ml-ease);
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 229, 255, .55);
  box-shadow:
    0 0 18px rgba(0, 229, 255, .24),
    0 0 46px rgba(255, 61, 240, .14);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--ml-txt-2);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.stat-value {
  font-family: "Oxanium", system-ui, sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--ml-cyan);
  text-shadow: 0 0 14px rgba(0, 229, 255, .45);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem;
  background: linear-gradient(180deg, var(--ml-panel-grad-1), var(--ml-panel-grad-2)), var(--ml-panel);
  border: 1px solid var(--ml-line);
  border-radius: var(--ml-r-1);
  box-shadow: var(--ml-sh-neon);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.35rem;
}

.filter-bar .form-group {
  margin-bottom: 0;
  min-width: 170px;
}

/* ---------- TICKET TABLE ---------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.ticket-table th,
.ticket-table td {
  padding: 0.85rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid var(--ml-line);
  vertical-align: middle;
}

.ticket-table th {
  background-color: var(--ml-table-head);
  font-family: "Oxanium", system-ui, sans-serif;
  font-weight: 700;
  color: var(--ml-cyan);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.ticket-table tr:hover td {
  background-color: var(--ml-row-hover);
}

.ticket-table tr.row-urgent td {
  background-color: rgba(255, 61, 240, .07);
}

.ticket-table tr.row-urgent:hover td {
  background-color: rgba(255, 61, 240, .13);
}

.ticket-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  color: var(--ml-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, .35);
}

/* ---------- NOTES & DETAILS ------------------------------- */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.note-item {
  background: var(--ml-input-bg);
  border: 1px solid var(--ml-line);
  border-left: 4px solid var(--ml-cyan);
  padding: 0.85rem 1.05rem;
  border-radius: 12px;
}

.note-meta {
  font-size: 0.82rem;
  color: var(--ml-txt-2);
  margin-bottom: 0.35rem;
  display: flex;
  justify-content: space-between;
}

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.35rem;
}

.meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.meta-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--ml-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.93rem;
}

.meta-list li:last-child {
  border-bottom: none;
}

/* ---------- FOOTER (.ml-footer) --------------------------- */
.ml-footer,
.footer {
  padding: 26px 16px 40px;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .02) 70%);
  border-top: 1px solid var(--ml-line);
  text-align: center;
  color: var(--ml-txt-2);
  font-size: 0.88rem;
  margin-top: 2.5rem;
}

@media (max-width: 768px) {
  .form-row,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .filter-bar .form-group {
    width: 100%;
  }
  .ml-brand-sub {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
