@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  --bg: #0f0d09;
  --panel: #18140d;
  --panel-2: #221b10;
  --line: #5a4524;
  --text: #fff8e6;
  --muted: #d7c49a;
  --soft: #a88645;
  --accent: #d6a84f;
  --accent-2: #f3d37a;
  --danger: #ff8a8a;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

body[data-theme="platinum"] {
  --bg: #0d0d0f;
  --panel: #18191b;
  --panel-2: #222326;
  --line: #73777f;
  --text: #f8f8f4;
  --muted: #c8c9c4;
  --soft: #a6a8ad;
  --accent: #c9c7bd;
  --accent-2: #f1eee3;
}

body[data-theme="emerald"] {
  --bg: #07110d;
  --panel: #0f1b15;
  --panel-2: #14271d;
  --line: #2e7d5f;
  --text: #f4fff9;
  --muted: #b7d8c9;
  --soft: #56a981;
  --accent: #31b57e;
  --accent-2: #98f0c7;
}

body[data-theme="ruby"] {
  --bg: #120707;
  --panel: #1d0f0f;
  --panel-2: #2a1515;
  --line: #7f3333;
  --text: #fff6f2;
  --muted: #e0bcb5;
  --soft: #b56565;
  --accent: #c64d4d;
  --accent-2: #ffb3a5;
}

body[data-theme="sapphire"] {
  --bg: #070b14;
  --panel: #101827;
  --panel-2: #14223a;
  --line: #315f9b;
  --text: #f4f8ff;
  --muted: #bccde8;
  --soft: #5d86c4;
  --accent: #4d8ed8;
  --accent-2: #a9d2ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(214, 168, 79, 0.14), transparent 30%),
    linear-gradient(135deg, #0c0a07 0%, #17120b 45%, #251b0e 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(180px, 1fr) 170px;
  align-items: center;
  min-height: 76px;
  border-bottom: 0;
  background: rgba(15, 13, 9, 0.92);
  backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 241, 166, 0.32),
    inset 0 -1px 0 rgba(90, 69, 36, 0.9),
    0 10px 30px rgba(0, 0, 0, 0.32);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8a6425 12%, #fff1a6 50%, #8a6425 88%, transparent);
  box-shadow: 0 0 18px rgba(214, 168, 79, 0.48);
}

.brand,
.account,
.search {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-right: 0;
  color: var(--text);
  text-decoration: none;
}

.brand,
.search {
  position: relative;
}

.brand::after,
.search::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 0;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 230, 154, 0.62), rgba(138, 100, 37, 0.85), transparent);
  box-shadow: 0 0 14px rgba(214, 168, 79, 0.38);
}

.brand {
  font-weight: 800;
  font-size: 17px;
  justify-content: center;
}

.brand-logo {
  display: block;
  width: 230px;
  max-width: 100%;
  max-height: 70px;
  object-fit: contain;
  transform: scale(1.72);
  transform-origin: center;
  filter: drop-shadow(0 0 10px rgba(255, 230, 154, 0.18));
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff1a6, #d6a84f 48%, #8a6425);
  color: #1a1308;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 8px 18px rgba(214, 168, 79, 0.22);
}

.avatar-img {
  object-fit: cover;
}

.search {
  position: relative;
  padding: 10px 14px;
}

.search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #14100a;
  color: var(--text);
  padding: 0 14px;
  outline: 0;
}

.search input:focus {
  border-color: var(--accent);
}

.account {
  border-right: 0;
  border-left: 0;
}

.account small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.logout-link {
  color: var(--muted);
  text-decoration: none;
}

.logout-link:hover {
  color: var(--text);
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 54px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(214, 168, 79, 0.24);
  background: rgba(24, 20, 13, 0.92);
  box-shadow: inset 0 -1px 0 rgba(255, 241, 166, 0.08);
  overflow-x: auto;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.nav a.active,
.nav a:hover {
  background: rgba(214, 168, 79, 0.14);
  color: #fff1a6;
}

.layout {
  padding: 20px 22px 42px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.crumb {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
}

h2 {
  font-size: 16px;
  margin-bottom: 7px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--soft);
  border-radius: 6px;
  overflow: hidden;
}

.segmented button {
  border: 0;
  border-right: 1px solid var(--soft);
  background: transparent;
  color: var(--text);
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 800;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button:only-child {
  border-right: 0;
}

.segmented button.active,
.segmented button:hover {
  background: rgba(214, 168, 79, 0.18);
  color: #fff1a6;
}

.overview-panel,
.metric,
.create-panel,
.links-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(43, 34, 19, 0.96), rgba(24, 20, 13, 0.96));
  box-shadow: var(--shadow);
}

.overview-panel {
  min-height: 150px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 1.6fr;
  gap: 24px;
  align-items: end;
  padding: 28px 14px 14px;
}

.overview-panel p,
.section-title p,
.metric small {
  color: var(--muted);
  margin-bottom: 0;
}

.filters {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  align-self: start;
}

.filters span {
  border: 1px solid var(--line);
  background: rgba(214, 168, 79, 0.08);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
}

.filters strong {
  color: var(--text);
}

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

.metric {
  min-height: 86px;
  padding: 14px;
}

.metric span {
  display: block;
  text-transform: uppercase;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin: 6px 0;
  font-size: 28px;
  line-height: 1;
}

.metric.wide {
  grid-column: span 2;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 12px;
}

.create-panel,
.links-panel,
.settings-panel,
.settings-card {
  padding: 16px;
}

.create-panel {
  display: grid;
  align-content: start;
  gap: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #14100a;
  color: var(--text);
  padding: 0 12px;
  outline: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

.primary,
.icon,
.link-button {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #17120b;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  overflow: hidden;
}

.primary {
  min-height: 42px;
  background: linear-gradient(135deg, #ffe69a, #d6a84f 52%, #916a28);
  border-color: #f3d37a;
  color: #171008;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 24px rgba(214, 168, 79, 0.22);
}

.message {
  min-height: 18px;
  color: var(--accent-2);
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  table-layout: fixed;
}

.col-shortlink {
  width: 260px;
}

.col-domain {
  width: 180px;
}

.col-destination {
  width: 260px;
}

.col-status {
  width: 130px;
}

.col-tracking {
  width: 260px;
}

.col-actions {
  width: 310px;
}

th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th:last-child,
.actions-cell {
  width: 310px;
  text-align: center;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.row-title {
  display: block;
  margin-bottom: 5px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 260px;
  padding: 0 10px;
  color: #f3d37a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destination {
  color: var(--muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain {
  color: #f3d37a;
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(214, 168, 79, 0.16);
  color: #ffe69a;
  font-weight: 900;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.status:hover {
  border-color: rgba(255, 230, 154, 0.42);
  box-shadow: 0 0 16px rgba(214, 168, 79, 0.2);
}

.status:active {
  transform: scale(0.96);
}

.status.inactive {
  background: rgba(255, 138, 138, 0.14);
  color: var(--danger);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  width: 100%;
  white-space: nowrap;
}

.icon {
  position: relative;
  width: 82px;
  min-height: 34px;
  padding: 0 12px;
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.icon::before,
.link-button::before,
.primary::before {
  content: "";
  position: absolute;
  inset: -40% auto -40% -70%;
  width: 52%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 241, 166, 0.45), transparent);
  opacity: 0;
}

.icon:hover,
.link-button:hover {
  border-color: #f3d37a;
  box-shadow: 0 0 18px rgba(214, 168, 79, 0.24);
}

.icon:hover::before,
.link-button:hover::before,
.primary:hover::before {
  animation: shine 850ms ease;
  opacity: 1;
}

.icon:active,
.link-button:active,
.primary:active {
  transform: translateY(1px) scale(0.97);
}

.copy {
  color: #ffe69a;
}

.edit {
  color: #f7ead0;
  border-color: rgba(214, 168, 79, 0.46);
}

.delete {
  border-color: rgba(255, 138, 138, 0.5);
  color: var(--danger);
}

.delete:hover {
  border-color: #ffb0b0;
  box-shadow: 0 0 18px rgba(255, 138, 138, 0.18);
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 10px;
  z-index: 20;
  pointer-events: none;
}

.toast {
  min-width: 250px;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 230, 154, 0.18), rgba(24, 20, 13, 0.98));
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.copy {
  border-color: #d6a84f;
}

.toast.delete {
  border-color: rgba(255, 138, 138, 0.65);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(8px);
  z-index: 30;
}

.modal-backdrop.active {
  display: grid;
}

.modal-card {
  width: min(520px, 100%);
  border: 1px solid rgba(255, 230, 154, 0.42);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 230, 154, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(45, 35, 18, 0.99), rgba(14, 11, 7, 0.99));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 0 34px rgba(214, 168, 79, 0.16),
    inset 0 1px 0 rgba(255, 241, 166, 0.18);
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.modal-head h2 {
  margin-bottom: 0;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(214, 168, 79, 0.36);
  border-radius: 8px;
  background: rgba(8, 6, 4, 0.48);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-card p {
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .primary {
  min-width: 170px;
}

.smart-fields {
  border: 1px solid rgba(214, 168, 79, 0.3);
  border-radius: 9px;
  background: rgba(8, 6, 4, 0.34);
  padding: 10px;
}

.smart-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 98px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(214, 168, 79, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 230, 154, 0.06), rgba(8, 6, 4, 0.36));
}

.smart-toggle > span {
  display: grid;
  gap: 3px;
}

.smart-toggle select {
  min-height: 36px;
  height: 36px;
  padding: 0 9px;
  font-weight: 900;
}

.smart-fields summary {
  cursor: pointer;
  color: #ffe69a;
  font-weight: 900;
}

.smart-fields label {
  margin-top: 12px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.smart-fields textarea,
.modal-card textarea {
  line-height: 1.45;
  font-weight: 700;
}

.country-blocker {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.country-blocker > div:first-child {
  display: grid;
  gap: 3px;
}

.country-search {
  min-height: 38px;
}

.country-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 238px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(214, 168, 79, 0.28);
  border-radius: 8px;
  background: rgba(8, 6, 4, 0.34);
}

.country-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(214, 168, 79, 0.18);
  border-radius: 7px;
  background: rgba(10, 8, 5, 0.58);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.country-option input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent);
}

.country-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-option small {
  color: var(--muted);
  font-weight: 900;
}

.country-option:has(input:checked) {
  border-color: rgba(255, 138, 138, 0.5);
  background: linear-gradient(180deg, rgba(255, 138, 138, 0.12), rgba(10, 8, 5, 0.78));
}

.modal-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.settings-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(43, 34, 19, 0.96), rgba(24, 20, 13, 0.96));
  box-shadow: var(--shadow);
}

.settings-panel > .section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(214, 168, 79, 0.28);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  margin-top: 18px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.settings-menu {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid rgba(214, 168, 79, 0.32);
  border-radius: 11px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 230, 154, 0.08), transparent 36%),
    rgba(12, 9, 5, 0.62);
  padding: 10px;
}

.settings-menu-item {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  text-align: left;
  padding: 0 13px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.settings-menu-item:hover,
.settings-menu-item.active {
  border-color: rgba(214, 168, 79, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 230, 154, 0.11), rgba(10, 8, 5, 0.7));
}

.settings-menu-item:active {
  transform: scale(0.98);
}

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

.settings-tab {
  display: none;
}

.settings-tab.active {
  display: block;
}

.settings-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.settings-tab .settings-card {
  min-height: 0;
  grid-column: auto;
}

.settings-card {
  display: grid;
  gap: 13px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 16, 10, 0.62);
}

.account-card,
.avatar-card,
.theme-card {
  grid-column: span 4;
}

.create-admin-card {
  grid-column: span 6;
}

.admins-card {
  grid-column: span 6;
}

.settings-card h3 {
  margin: 0;
  font-size: 15px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(214, 168, 79, 0.24);
  border-radius: 8px;
  padding: 10px;
  background: rgba(15, 13, 9, 0.72);
}

.admin-controls {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 74px 74px;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 340px);
}

.admin-controls input {
  min-height: 34px;
  font-size: 13px;
}

.admin-row strong,
.admin-row small {
  display: block;
}

.admin-row small {
  color: var(--muted);
  margin-top: 3px;
}

.admin-row .icon:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.admin-controls input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.avatar-preview-wrap {
  display: grid;
  place-items: center;
  min-height: 132px;
  border: 1px solid rgba(214, 168, 79, 0.28);
  border-radius: 10px;
  background: rgba(8, 6, 4, 0.38);
}

.avatar-card input[type="file"] {
  display: flex;
  align-items: center;
  padding: 9px;
  height: auto;
  min-height: 44px;
}

.theme-card {
  gap: 14px;
}

.theme-options {
  grid-template-columns: 1fr;
}

.avatar-preview {
  width: 86px;
  height: 86px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(255, 230, 154, 0.46);
  box-shadow: 0 0 22px rgba(214, 168, 79, 0.2);
}

.avatar-preview.empty {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff1a6, #d6a84f 48%, #8a6425);
  color: #1a1308;
  font-weight: 900;
  font-size: 30px;
}

.theme-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.theme-options {
  display: grid;
  gap: 9px;
}

.theme-option {
  display: grid;
  grid-template-columns: 18px 34px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(214, 168, 79, 0.28);
  border-radius: 9px;
  background: rgba(8, 6, 4, 0.36);
  padding: 10px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.theme-option:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.theme-option input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent);
}

.theme-option strong {
  color: var(--text);
  font-size: 13px;
}

.theme-swatch {
  width: 34px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.theme-swatch.gold {
  background: linear-gradient(135deg, #fff1a6, #d6a84f 50%, #5a3710);
}

.theme-swatch.platinum {
  background: linear-gradient(135deg, #ffffff, #a6a8ad 50%, #1b1c20);
}

.theme-swatch.emerald {
  background: linear-gradient(135deg, #98f0c7, #31b57e 50%, #07110d);
}

.theme-swatch.ruby {
  background: linear-gradient(135deg, #ffb3a5, #c64d4d 50%, #1b0707);
}

.theme-swatch.sapphire {
  background: linear-gradient(135deg, #a9d2ff, #4d8ed8 50%, #070b14);
}

body:not([data-theme="gold"]) {
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 30%),
    linear-gradient(135deg, var(--bg), var(--panel) 48%, var(--panel-2));
}

body:not([data-theme="gold"]) .topbar::after,
body:not([data-theme="gold"]) .login-card::after {
  background: linear-gradient(90deg, transparent, var(--line), var(--accent-2), var(--line), transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 48%, transparent);
}

body:not([data-theme="gold"]) .overview-panel,
body:not([data-theme="gold"]) .metric,
body:not([data-theme="gold"]) .create-panel,
body:not([data-theme="gold"]) .links-panel,
body:not([data-theme="gold"]) .settings-panel,
body:not([data-theme="gold"]) .settings-card {
  border-color: color-mix(in srgb, var(--accent) 46%, transparent);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 88%, #000 12%), color-mix(in srgb, var(--panel) 86%, #000 14%));
}

body:not([data-theme="gold"]) .primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 52%, var(--line));
  border-color: var(--accent-2);
}

body:not([data-theme="gold"]) .links-panel tbody tr {
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 35%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 82%, #000 18%), color-mix(in srgb, var(--panel) 78%, #000 22%));
}

body:not([data-theme="gold"]) .link-button,
body:not([data-theme="gold"]) .track-chip,
body:not([data-theme="gold"]) .valid-chip,
body:not([data-theme="gold"]) .filters span,
body:not([data-theme="gold"]) .status {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, transparent), rgba(10, 8, 5, 0.78));
}

@keyframes shine {
  from {
    left: -70%;
  }
  to {
    left: 120%;
  }
}

/* Premium dashboard polish */
.layout {
  padding: 28px 28px 48px;
}

.page-head {
  margin-bottom: 20px;
  padding: 2px 2px 0;
}

.crumb {
  color: #f3d37a;
  font-size: 13px;
}

h1 {
  font-size: 29px;
  line-height: 1.08;
  text-shadow: 0 0 20px rgba(214, 168, 79, 0.18);
}

h2 {
  font-size: 18px;
}

.overview-panel,
.metric,
.create-panel,
.links-panel,
.settings-panel,
.settings-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(214, 168, 79, 0.46);
  border-radius: 11px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 230, 154, 0.09), transparent 34%),
    linear-gradient(180deg, rgba(47, 37, 19, 0.98), rgba(20, 16, 10, 0.98));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 241, 166, 0.12);
}

.overview-panel::before,
.metric::before,
.create-panel::before,
.links-panel::before,
.settings-panel::before,
.settings-card::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 241, 166, 0.62), transparent);
  pointer-events: none;
}

.overview-panel {
  min-height: 156px;
  padding: 34px 22px 22px;
  margin-bottom: 16px;
}

.overview-panel h2,
.section-title h2 {
  color: #fff8e6;
  text-shadow: 0 0 16px rgba(214, 168, 79, 0.14);
}

.overview-panel p,
.section-title p,
.metric small {
  color: #d9c38d;
}

.filters {
  gap: 10px;
}

.filters span {
  padding: 8px 13px;
  background:
    linear-gradient(180deg, rgba(214, 168, 79, 0.14), rgba(20, 16, 10, 0.58));
  box-shadow: inset 0 1px 0 rgba(255, 241, 166, 0.13);
}

.stats-grid {
  gap: 14px;
  margin: 0 0 16px;
}

.metric {
  min-height: 106px;
  padding: 18px;
}

.metric span {
  color: #ffe69a;
  font-weight: 900;
}

.metric strong {
  margin: 9px 0 8px;
  font-size: 34px;
  color: #fff8e6;
  text-shadow: 0 0 18px rgba(214, 168, 79, 0.2);
}

.motto-card strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  font-size: clamp(18px, 2vw, 28px);
  text-align: center;
  white-space: nowrap;
  transition: opacity 220ms ease, transform 220ms ease, filter 220ms ease;
}

.motto-card strong.changing {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(3px);
}

.motto-card small {
  display: block;
  text-align: center;
  color: #d9c38d;
}

.motto-card {
  isolation: isolate;
}

.motto-card span,
.motto-card strong,
.motto-card small {
  position: relative;
  z-index: 2;
}

.motto-card span {
  text-align: center;
}

.motto-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.48;
  background:
    radial-gradient(ellipse at 12% 120%, rgba(255, 230, 154, 0.28) 0 9px, transparent 10px),
    radial-gradient(ellipse at 34% 120%, rgba(214, 168, 79, 0.22) 0 7px, transparent 8px),
    radial-gradient(ellipse at 58% 120%, rgba(255, 241, 166, 0.24) 0 8px, transparent 9px),
    radial-gradient(ellipse at 82% 120%, rgba(214, 168, 79, 0.2) 0 6px, transparent 7px);
  animation: lotusDrift 5.5s linear infinite;
}

@keyframes lotusDrift {
  0% {
    background-position: 0 78px, 0 96px, 0 86px, 0 104px;
    filter: blur(0);
  }
  50% {
    background-position: 18px 24px, -12px 34px, 10px 26px, -18px 38px;
    filter: blur(0.4px);
  }
  100% {
    background-position: 34px -42px, -22px -36px, 18px -48px, -32px -30px;
    filter: blur(0);
  }
}

.workspace {
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 16px;
}

.create-panel,
.links-panel,
.settings-panel,
.settings-card {
  padding: 20px;
}

.create-panel {
  gap: 15px;
}

input,
select,
textarea {
  min-height: 44px;
  border-radius: 7px;
  background: rgba(8, 6, 4, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 241, 166, 0.06);
}

input:focus,
select:focus,
textarea:focus {
  box-shadow:
    0 0 0 3px rgba(214, 168, 79, 0.12),
    inset 0 1px 0 rgba(255, 241, 166, 0.08);
}

.primary {
  min-height: 46px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 16px 12px;
}

th {
  color: #ffe69a;
  font-weight: 900;
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: rgba(214, 168, 79, 0.045);
}

.row-title {
  margin-bottom: 7px;
  color: #fff8e6;
}

.link-button {
  min-height: 36px;
  padding: 0 12px;
}

.status {
  min-height: 28px;
  padding: 0 12px;
}

/* Premium typography and shortlink list */
body,
button,
input,
select {
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
}

h1,
h2,
.section-title h2,
.overview-panel h2 {
  font-family: "Cinzel", "Manrope", serif;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

.links-panel .section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(214, 168, 79, 0.28);
}

.links-panel .section-title h2 {
  margin-bottom: 3px;
}

.links-panel table {
  border-collapse: separate;
  border-spacing: 0 12px;
}

.links-panel th {
  padding: 4px 14px 8px;
  border-bottom: 0;
  color: #ffe69a;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(214, 168, 79, 0.22);
}

.links-panel td {
  padding: 18px 14px;
  border-bottom: 0;
}

.links-panel tbody tr {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 230, 154, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(39, 30, 15, 0.9), rgba(17, 13, 8, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 241, 166, 0.1),
    0 12px 26px rgba(0, 0, 0, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.links-panel tbody tr:hover {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 230, 154, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(55, 42, 21, 0.94), rgba(22, 16, 9, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 241, 166, 0.16),
    0 16px 34px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.links-panel tbody td:first-child {
  border-radius: 10px 0 0 10px;
}

.links-panel tbody td:last-child {
  border-radius: 0 10px 10px 0;
}

.row-title {
  margin-bottom: 9px;
  color: #fff8e6;
  font-size: 14px;
  font-weight: 900;
}

.smart-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(126, 224, 129, 0.36);
  border-radius: 999px;
  background: rgba(126, 224, 129, 0.12);
  color: #c8f7ba;
  font-size: 10px;
  font-weight: 900;
  vertical-align: middle;
}

.link-button {
  min-height: 38px;
  border-color: rgba(243, 211, 122, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 230, 154, 0.1), rgba(10, 8, 5, 0.88));
  color: #fff8e6;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 241, 166, 0.12),
    0 0 18px rgba(214, 168, 79, 0.08);
}

.domain {
  color: #fff8e6;
  font-weight: 900;
  text-shadow: 0 0 14px rgba(214, 168, 79, 0.2);
}

.destination,
.clicks {
  color: #fff8e6;
  font-weight: 700;
}

.track-grid {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.track-chip,
.valid-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid rgba(214, 168, 79, 0.34);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 230, 154, 0.08), rgba(10, 8, 5, 0.78));
  color: #fff8e6;
  padding: 0 10px;
  box-shadow: inset 0 1px 0 rgba(255, 241, 166, 0.08);
}

.track-chip {
  gap: 5px;
}

.track-chip strong {
  font-size: 14px;
  font-weight: 900;
}

.track-chip small {
  color: #d7c49a;
  font-size: 11px;
  font-weight: 800;
}

.valid-chip {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.valid-chip.valid {
  border-color: rgba(126, 224, 129, 0.38);
  color: #c8f7ba;
  background: linear-gradient(180deg, rgba(126, 224, 129, 0.13), rgba(10, 8, 5, 0.78));
}

.valid-chip.invalid {
  border-color: rgba(255, 138, 138, 0.42);
  color: #ffb0b0;
  background: linear-gradient(180deg, rgba(255, 138, 138, 0.12), rgba(10, 8, 5, 0.78));
}

.links-panel th {
  color: #f7ead0;
}

.status {
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 241, 166, 0.12);
}

.icon {
  font-weight: 900;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(214, 168, 79, 0.22), transparent 24%),
    radial-gradient(circle at 16% 12%, rgba(243, 211, 122, 0.12), transparent 28%),
    linear-gradient(135deg, #080604, #18120a 48%, #2a1d0d);
}

.login-shell {
  width: min(520px, 100%);
}

.login-card {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(255, 230, 154, 0.38);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(60, 47, 24, 0.98), rgba(20, 16, 10, 0.99));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.48),
    0 0 34px rgba(214, 168, 79, 0.14),
    inset 0 1px 0 rgba(255, 241, 166, 0.28);
  padding: 34px 34px 30px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 241, 166, 0.18), transparent 34%, rgba(214, 168, 79, 0.12)),
    radial-gradient(circle at 50% 0%, rgba(255, 230, 154, 0.22), transparent 38%);
}

.login-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8a6425, #fff1a6, #8a6425, transparent);
  box-shadow: 0 0 18px rgba(243, 211, 122, 0.48);
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  margin-bottom: 10px;
}

.login-logo {
  display: block;
  width: 330px;
  max-width: 100%;
  max-height: 138px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(255, 230, 154, 0.18));
}

.login-brand h1 {
  font-size: 22px;
}

.login-brand p {
  color: var(--muted);
  margin-bottom: 0;
}

.login-error {
  border: 1px solid rgba(255, 138, 138, 0.5);
  border-radius: 6px;
  background: rgba(255, 138, 138, 0.12);
  color: var(--danger);
  padding: 10px 12px;
  margin-bottom: 0;
}

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

  .brand,
  .account,
  .search {
    min-height: 48px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-logo {
    transform: scale(1.25);
  }

  .page-head,
  .overview-panel {
    display: block;
  }

  .segmented,
  .filters {
    margin-top: 14px;
  }

  .stats-grid,
  .workspace,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .account-card,
  .avatar-card,
  .theme-card,
  .create-admin-card,
  .admins-card {
    grid-column: auto;
  }

  .settings-layout,
  .settings-stack {
    grid-template-columns: 1fr;
  }

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

  .settings-menu-item {
    text-align: center;
  }

  .metric.wide {
    grid-column: auto;
  }
}

@media (max-width: 1180px) {
  .layout {
    padding: 18px 14px 34px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .create-panel,
  .links-panel {
    width: 100%;
  }

  .links-panel .section-title {
    display: block;
  }

  .links-panel .section-title p {
    margin-top: 6px;
  }

  .links-panel table,
  .links-panel colgroup,
  .links-panel thead,
  .links-panel tbody,
  .links-panel tr,
  .links-panel th,
  .links-panel td {
    display: block;
    width: 100%;
  }

  .links-panel table {
    min-width: 0;
    border-spacing: 0;
  }

  .links-panel thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .links-panel tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid rgba(214, 168, 79, 0.28);
    border-radius: 12px;
  }

  .links-panel tbody td {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
  }

  .links-panel tbody td::before {
    content: attr(data-label);
    color: #d7c49a;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .links-panel tbody td:first-child,
  .links-panel tbody td:last-child {
    border-radius: 0;
  }

.link-button,
.destination,
.domain {
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain,
.destination {
  width: 100%;
}

  .track-grid {
    justify-content: flex-start;
  }

  .actions-cell {
    width: 100%;
    text-align: left;
  }

  .actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

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

  .brand,
  .search,
  .account {
    justify-content: center;
  }

  .search::after,
  .brand::after {
    display: none;
  }

  .nav {
    justify-content: center;
  }

  .page-head {
    display: block;
  }

  h1 {
    font-size: 24px;
  }

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

  .links-panel tbody td {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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

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

  .icon {
    width: 100%;
  }
}

/* Compact country blocker */
.country-blocker {
  gap: 8px;
}

.country-search {
  min-height: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.country-list {
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 9px;
  max-height: 220px;
  padding: 9px;
}

.country-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.15;
}

.country-option[hidden] {
  display: none !important;
}

.country-option input,
.country-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  box-shadow: none;
}

.country-option span {
  min-width: 0;
  flex: 1 1 auto;
}

.country-option small {
  flex: 0 0 auto;
  font-size: 11px;
}

@media (max-width: 640px) {
  .country-list {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
}
