/* ==========================================================================
   ShortFlare Design System — Grounded in Figma Ref 1 (Light/Dark Table 1110px)
   & Figma Ref 2 (#684AFF Electric Indigo-Violet + Responsive Dynamic Table)
   Zero external fonts/CDNs. Strict CSP ('self') compliant.
   ========================================================================== */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #141529;
  --bg-surface: #1D1E42;
  --bg-row-alt: #26264F;
  --bg-row-hover: #2C2E5E;
  --bg-elevated: #26264F;
  --bg-popover: #111224;
  --bg-input: #141529;
  --border-subtle: #323465;
  --border-strong: #4A4D8F;
  --text-primary: #FFFFFF;
  --text-secondary: #A3A6C2;
  --text-muted: #787CA3;

  --accent: #684AFF;
  --accent-hover: #5839F2;
  --accent-soft: rgba(104, 74, 255, 0.16);
  --row-flash: rgba(104, 74, 255, 0.28);

  --status-active-fg: #34D399;
  --status-active-bg: rgba(16, 185, 129, 0.15);
  --status-expiring-fg: #FBBF24;
  --status-expiring-bg: rgba(245, 158, 11, 0.16);
  --status-expired-fg: #F87171;
  --status-expired-bg: rgba(239, 68, 68, 0.16);

  --danger: #EF4444;
  --danger-hover: #DC2626;
  --shadow-card: 0 12px 32px rgba(7, 8, 22, 0.35);
  --shadow-pop: 0 10px 24px rgba(5, 6, 18, 0.55);
  --backdrop: rgba(10, 11, 24, 0.72);
  --sk-base: #282A54;
  --sk-shine: #363970;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #F7F6FE;
  --bg-surface: #FFFFFF;
  --bg-row-alt: #F7F6FE;
  --bg-row-hover: #EFEFFD;
  --bg-elevated: #F2F1FC;
  --bg-popover: #1F2937;
  --bg-input: #FFFFFF;
  --border-subtle: #E6E8F0;
  --border-strong: #CBD0E2;
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;

  --accent: #684AFF;
  --accent-hover: #5535F2;
  --accent-soft: rgba(104, 74, 255, 0.1);
  --row-flash: rgba(104, 74, 255, 0.16);

  --status-active-fg: #059669;
  --status-active-bg: #DCFCE7;
  --status-expiring-fg: #B45309;
  --status-expiring-bg: #FEF3C7;
  --status-expired-fg: #DC2626;
  --status-expired-bg: #FEE2E2;

  --danger: #DC2626;
  --danger-hover: #B91C1C;
  --shadow-card: 0 8px 24px rgba(17, 24, 39, 0.05);
  --shadow-pop: 0 10px 24px rgba(17, 24, 39, 0.18);
  --backdrop: rgba(17, 24, 39, 0.5);
  --sk-base: #ECEAF9;
  --sk-shine: #F6F5FD;
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 160ms ease, color 160ms ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  max-width: 1110px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Top Application Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark img {
  display: block;
  border-radius: 8px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-flare {
  color: #FF8C24;
}

.brand-host {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons & Spinners */
button,
input,
select {
  font: inherit;
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 90ms ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
}

.btn-secondary {
  background-color: var(--bg-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled),
.btn-secondary[aria-expanded="true"] {
  border-color: var(--border-strong);
}

.btn-ghost {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-danger {
  background-color: var(--danger);
  color: #FFFFFF;
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--danger-hover);
}

.btn-icon-only {
  width: 34px;
  padding: 0;
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  animation: spin 650ms linear infinite;
  flex-shrink: 0;
}

.is-spinning {
  animation: spin 700ms linear infinite;
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Pill Badges */
.pill-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill-dev {
  background-color: var(--status-expiring-bg);
  color: var(--status-expiring-fg);
}

/* Session Expiry Banner */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 10px;
  background-color: var(--status-expired-bg);
  border: 1px solid var(--status-expired-fg);
  color: var(--text-primary);
}

/* Inline Quick-Create Card */
.create-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.create-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px auto;
  gap: 10px;
  align-items: center;
}

.input-with-hint,
.slug-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

input[type="url"],
input[type="text"],
input[type="search"],
input[type="datetime-local"],
select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color 120ms ease;
}

input:hover,
select:hover {
  border-color: var(--border-strong);
}

input::placeholder {
  color: var(--text-muted);
}

.input-with-hint input {
  padding-right: 34px;
}

.kbd-hint {
  position: absolute;
  right: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  pointer-events: none;
}

.slug-prefix {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  pointer-events: none;
}

.slug-input-group input {
  padding-left: 22px;
  padding-right: 34px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
}

.btn-inline-icon {
  position: absolute;
  right: 5px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.btn-inline-icon:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.create-cta-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.create-cta-group .btn {
  height: 38px;
}

.create-extra-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  animation: revealDown 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes revealDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Clean Field Labels + Interactive (i) Info Popover */
.label-with-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.field-label {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-field > .field-label {
  display: block;
  margin-bottom: 6px;
}

.char-counter {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-trigger {
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease;
}

.info-trigger:hover,
.info-trigger[aria-expanded="true"] {
  color: var(--accent);
  background-color: var(--accent-soft);
}

.info-popover {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 260px;
  padding: 9px 12px;
  border-radius: 8px;
  background-color: var(--bg-popover);
  border: 1px solid var(--border-strong);
  color: #F9FAFB;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  box-shadow: var(--shadow-pop);
  animation: popFade 130ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popFade {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

.muted {
  color: var(--text-muted);
  font-weight: 400;
}

.expiry-row {
  display: flex;
  gap: 8px;
}

.current-expiry-hint {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.field-feedback {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--status-expired-fg);
}

/* ==========================================================================
   Figma Ref 1 Table Card (64px Toolbar / 49px Header / 64px Rows / 63px Footer)
   ========================================================================== */
.table-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: visible;
  box-shadow: var(--shadow-card);
}

.table-toolbar {
  min-height: 64px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 12px 12px 0 0;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.entries-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.entries-control select {
  width: auto;
  height: 32px;
  padding: 0 26px 0 10px;
  border-radius: 8px;
  background-color: var(--bg-elevated);
  font-size: 12.5px;
  font-weight: 500;
}

.search-control {
  position: relative;
  width: 240px;
  display: flex;
  align-items: center;
}

.search-control input {
  height: 32px;
  padding-left: 32px;
  padding-right: 30px;
  border-radius: 8px;
  font-size: 13px;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.filter-chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.filter-chip {
  height: 26px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.filter-chip:hover {
  color: var(--text-primary);
}

.filter-chip.is-active {
  background-color: var(--accent);
  color: #FFFFFF;
}

.count-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Table Structure */
.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.links-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.links-table thead tr {
  height: 49px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.links-table th {
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
}

.th-sort:hover,
.th-sort.is-sorted {
  color: var(--text-primary);
}

.sort-icon {
  opacity: 0.45;
}

.th-sort.is-sorted .sort-icon {
  opacity: 1;
  color: var(--accent);
}

.links-table tbody tr {
  height: 64px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 120ms ease;
}

.links-table tbody tr:nth-child(odd) {
  background-color: var(--bg-row-alt);
}

.links-table tbody tr:nth-child(even) {
  background-color: var(--bg-surface);
}

.links-table tbody tr.data-row:hover {
  background-color: var(--bg-row-hover);
}

.links-table tbody tr.row-just-created {
  animation: highlightNewRow 1.1s ease-out;
}

@keyframes highlightNewRow {
  0% {
    background-color: var(--row-flash);
  }
  100% {
    background-color: var(--bg-row-alt);
  }
}

.links-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

.col-slug {
  min-width: 265px;
}

.col-dest {
  min-width: 245px;
}

.col-note {
  width: 170px;
}

.col-date {
  width: 112px;
}

.col-status {
  width: 128px;
}

.col-action {
  width: 98px;
  text-align: center;
}

/* Skeleton Shimmer Rows */
.sk {
  display: inline-block;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--sk-base) 25%, var(--sk-shine) 50%, var(--sk-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

.sk-slug {
  width: 150px;
}

.sk-dest-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sk-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.sk-url {
  width: 165px;
}

.sk-note {
  width: 105px;
}

.sk-date {
  width: 78px;
}

.sk-pill {
  width: 74px;
  height: 28px;
  border-radius: 999px;
}

.sk-act {
  width: 56px;
  height: 22px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Cell 1: Full Short Link (no https://) + Custom Split Copy Host Menu */
.slug-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slug-link {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  text-decoration: none;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.slug-host {
  color: var(--text-secondary);
  font-weight: 400;
}

.slug-key {
  color: var(--text-primary);
  font-weight: 600;
}

.slug-link:hover .slug-host,
.slug-link:hover .slug-key {
  color: var(--accent);
  text-decoration: underline;
}

.copy-split {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background-color: var(--bg-elevated);
  flex-shrink: 0;
  transition: border-color 120ms ease;
}

.copy-split:hover {
  border-color: var(--border-strong);
}

.icon-btn {
  width: 28px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.icon-btn:hover {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.icon-btn.is-copied {
  color: var(--status-active-fg);
}

.copy-caret-btn {
  width: 22px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-left: 1px solid var(--border-subtle);
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.copy-caret-btn:hover,
.copy-caret-btn[aria-expanded="true"] {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.host-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 225px;
  padding: 6px;
  border-radius: 10px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
  animation: hostMenuPop 130ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hostMenuPop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.host-menu-title {
  padding: 4px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.host-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background-color 110ms ease, color 110ms ease;
}

.host-menu-item:hover {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.host-menu-tag {
  font-family: Inter, system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background-color: var(--bg-elevated);
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Cell 2: 32x32 Privacy-Safe Monogram + Domain + Muted Path */
.dest-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
}

.domain-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.dest-text {
  min-width: 0;
  flex: 1;
}

.dest-domain-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dest-domain {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dest-ext-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  flex-shrink: 0;
}

.dest-ext-link:hover {
  color: var(--accent);
}

.dest-path {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cell 3 & 4: Note & Date */
.note-text {
  display: block;
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 13px;
}

.note-empty {
  color: var(--text-muted);
}

.date-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: default;
}

/* Cell 5: Status Pill + Readable Expiry Subtext */
.status-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 11px;
  border-radius: 22px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
}

.status-subdate {
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 4px;
  white-space: nowrap;
}

.status-active {
  background-color: var(--status-active-bg);
  color: var(--status-active-fg);
}

.status-expiring {
  background-color: var(--status-expiring-bg);
  color: var(--status-expiring-fg);
}

.status-expired {
  background-color: var(--status-expired-bg);
  color: var(--status-expired-fg);
}

/* Cell 6: Action Icons */
.action-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--accent);
  transition: background-color 120ms ease, transform 90ms ease;
}

.action-btn:hover {
  background-color: var(--accent-soft);
}

.action-btn:active {
  transform: scale(0.94);
}

.action-btn-delete {
  color: var(--status-expired-fg);
}

.action-btn-delete:hover {
  background-color: var(--status-expired-bg);
}

.state-row td {
  height: 140px;
  text-align: center;
  color: var(--text-secondary);
}

/* 63px Pagination Footer */
.table-footer {
  min-height: 63px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-summary {
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-btn {
  min-width: 31px;
  height: 31px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.page-btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.page-btn.is-current {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.security-footnote {
  margin: 16px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Beszel-style Minimal Version & GitHub Footer */
.app-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer-link,
.footer-version {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 120ms ease;
}

.footer-link:hover,
.footer-version:hover {
  color: var(--text-primary);
}

.footer-sep {
  opacity: 0.45;
  user-select: none;
}

/* Built-in Login & Setup Required Centered Screens */
.center-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 390px;
  padding: 28px 26px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  animation: modalEnter 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-brand img {
  display: block;
  border-radius: 9px;
}

.auth-heading,
.setup-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.setup-title {
  margin-top: 10px;
}

.auth-sub,
.setup-desc {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

.setup-desc {
  margin-bottom: 0;
  word-break: break-word;
}

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

.secret-input-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13.5px;
}

.btn-full {
  width: 100%;
  height: 38px;
  margin-top: 14px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: var(--backdrop);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fadeBackdrop 140ms ease;
}

.modal-panel {
  width: 100%;
  max-width: 460px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  overflow: visible;
  animation: modalEnter 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.btn-close-modal {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-close-modal:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.modal-body {
  padding: 18px 20px;
}

.modal-field {
  margin-bottom: 14px;
}

.modal-field:last-child {
  margin-bottom: 0;
}

.mt-8 {
  margin-top: 8px;
}

.readonly-slug {
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  background-color: var(--bg-elevated);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  color: var(--accent);
}

.modal-copy {
  margin: 0 0 8px;
  color: var(--text-primary);
}

.mono-inline {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px;
}

.muted-url-preview {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Import Progress & Settings */
.quota-warning {
  padding: 12px;
  border-radius: 8px;
  background-color: var(--status-expiring-bg);
  color: var(--status-expiring-fg);
  font-size: 12.5px;
  margin-top: 12px;
}

.quota-warning p {
  margin: 4px 0 0;
}

.progress-wrap {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

progress {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  accent-color: var(--accent);
}

.settings-list {
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-item dt {
  color: var(--text-secondary);
  font-size: 13px;
}

.dt-with-info {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.settings-item dd {
  margin: 0;
  text-align: right;
  word-break: break-all;
}

.shortcuts-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-secondary);
}

.shortcuts-grid kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 60;
  padding: 11px 16px;
  border-radius: 10px;
  background-color: var(--accent);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  animation: toastSlide 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced Motion Respect */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive Dynamic Table (Figma Ref 2 Mobile Adaptation) */
@media (max-width: 820px) {
  .create-main-row {
    grid-template-columns: 1fr;
  }

  .create-extra-row {
    grid-template-columns: 1fr;
  }

  .search-control {
    width: 100%;
  }

  .info-popover {
    left: 0;
    top: calc(100% + 6px);
    transform: none;
  }
}

@media (max-width: 640px) {
  .topbar-actions span {
    display: none;
  }

  .links-table thead {
    display: none;
  }

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

  .links-table tbody tr {
    height: auto;
    padding: 12px 16px;
  }

  .links-table td {
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
  }

  .links-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
  }

  .status-stack {
    align-items: flex-end;
  }

  .slug-cell {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .slug-link {
    max-width: none;
    white-space: normal;
    word-break: break-all;
    text-align: right;
  }

  .host-menu {
    left: auto;
    right: 0;
  }

  .dest-cell {
    max-width: 220px;
    text-align: left;
  }

  .state-row td {
    display: block;
    text-align: center;
  }

  .state-row td::before {
    content: none;
  }
}
