:root {
  color-scheme: dark;
  --bg: #0b100e;
  --panel: rgba(20, 28, 25, 0.82);
  --panel-solid: #141c19;
  --line: #29352f;
  --muted: #8e9c95;
  --text: #eef4f0;
  --accent: #c6f36b;
  --accent-dark: #17210e;
  --danger: #ff857d;
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 45% -10%, #1a2a20 0, transparent 34rem), var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
select { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.ambient { position: fixed; pointer-events: none; border-radius: 999px; filter: blur(90px); opacity: .1; z-index: 0; }
.ambient-one { width: 22rem; height: 22rem; background: var(--accent); top: 10%; left: -14rem; }
.ambient-two { width: 18rem; height: 18rem; background: #5bc8a0; right: -12rem; bottom: 8%; }
.glass { background: var(--panel); border: 1px solid rgba(144, 164, 153, .18); box-shadow: 0 30px 90px rgba(0, 0, 0, .25); backdrop-filter: blur(18px); }
.eyebrow { margin: 0 0 .8rem; color: var(--accent); font-size: .69rem; font-weight: 750; letter-spacing: .18em; }
em { color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }

.login-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.login-card { width: min(100%, 31rem); padding: clamp(2rem, 6vw, 3.5rem); border-radius: 28px; }
.brand-mark { width: 3.2rem; height: 3.2rem; display: grid; place-items: center; margin-bottom: 2rem; background: var(--accent); border-radius: 14px; position: relative; }
.brand-mark span { position: absolute; width: 1.45rem; height: .24rem; background: var(--accent-dark); border-radius: 1rem; transform: rotate(-45deg); }
.brand-mark span:first-child::after { content: ""; position: absolute; width: .7rem; height: .7rem; border-top: .24rem solid var(--accent-dark); border-right: .24rem solid var(--accent-dark); right: -.05rem; top: -.24rem; border-radius: 2px; }
.brand-mark span:last-child { opacity: .22; transform: translate(-.36rem, .36rem) rotate(-45deg); }
.login-card h1, .hero h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: .97; letter-spacing: -.055em; }
.login-card h1 { font-size: clamp(2.5rem, 8vw, 3.8rem); }
.login-form { margin-top: 2rem; }
.login-form label, .field label { display: block; color: #b8c4bd; font-size: .77rem; font-weight: 650; margin-bottom: .55rem; }
.input-action { display: flex; gap: .5rem; }
input { width: 100%; color: var(--text); background: #0e1512; border: 1px solid var(--line); border-radius: 12px; outline: none; padding: .9rem 1rem; transition: border-color .18s, box-shadow .18s; }
input:focus { border-color: rgba(198, 243, 107, .72); box-shadow: 0 0 0 3px rgba(198, 243, 107, .09); }
.icon-button { width: 3.25rem; flex: 0 0 3.25rem; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-dark); font-weight: 800; font-size: 1.2rem; }
.form-error { min-height: 1.2rem; margin: .7rem 0 0; color: var(--danger); font-size: .8rem; }

.app-shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 3rem)); margin: 0 auto; }
.topbar { height: 84px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(142, 156, 149, .16); }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.brand-mark.small { width: 2rem; height: 2rem; margin: 0; border-radius: 8px; }
.brand-mark.small span { width: .95rem; height: .16rem; }
.brand-mark.small span:first-child::after { width: .45rem; height: .45rem; border-width: .16rem; top: -.16rem; }
.top-actions { display: flex; align-items: center; gap: 1.2rem; color: var(--muted); font-size: .76rem; }
.status-dot { display: flex; align-items: center; gap: .45rem; }
.status-dot i { width: .48rem; height: .48rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(198, 243, 107, .1); }
.text-button { border: 0; background: transparent; color: var(--muted); padding: .4rem; }
.text-button:hover { color: var(--text); }

main { padding: 6rem 0 2rem; }
.hero { display: grid; grid-template-columns: 1.4fr .6fr; align-items: end; gap: 4rem; margin-bottom: 3.2rem; }
.hero-note { color: var(--muted); line-height: 1.75; margin: 0 0 .35rem; max-width: 24rem; }
.creator { padding: 1.3rem; border-radius: var(--radius); }
.destination-field input { height: 4rem; font-size: 1rem; background: #0c1210; }
.creator-secondary { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 1rem; margin-top: 1rem; }
.field label span { color: #66736c; font-weight: 500; margin-left: .25rem; }
.slug-input { display: flex; align-items: center; background: #0e1512; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.slug-input:focus-within { border-color: rgba(198, 243, 107, .72); box-shadow: 0 0 0 3px rgba(198, 243, 107, .09); }
.slug-input span { color: #65736b; padding-left: 1rem; }
.slug-input input { border: 0; box-shadow: none; background: transparent; padding-left: .35rem; }
.duration-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; background: #0e1512; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color .18s, box-shadow .18s; }
.duration-input:focus-within { border-color: rgba(198, 243, 107, .72); box-shadow: 0 0 0 3px rgba(198, 243, 107, .09); }
.duration-input input { min-width: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.duration-unit { position: relative; display: flex; align-items: center; border-left: 1px solid var(--line); }
.duration-unit select { height: 100%; min-width: 5.4rem; appearance: none; color: #c4d0c9; border: 0; outline: 0; background: transparent; padding: 0 2rem 0 .9rem; cursor: pointer; }
.duration-unit option { color: var(--text); background: var(--panel-solid); }
.duration-unit i { position: absolute; right: .8rem; color: #65736b; font-style: normal; pointer-events: none; transform: translateY(-.08rem); }
.primary-button { height: 3.2rem; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-dark); padding: 0 1.2rem; font-weight: 780; display: flex; align-items: center; gap: 1.3rem; transition: transform .15s, filter .15s; }
.primary-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.primary-button b { font-size: 1.05rem; }
.result-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.2rem; margin-top: 1rem; padding: 1rem; border-radius: 16px; background: rgba(198, 243, 107, .08); border: 1px solid rgba(198, 243, 107, .22); }
.result-details { min-width: 0; padding-left: .15rem; }
.result-label { display: block; color: #9aaa9f; font-size: .7rem; margin-bottom: .25rem; }
.result-card a { display: block; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; font-weight: 650; }
.result-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.15rem; }
.copy-button { color: var(--text); border: 1px solid #3a4a42; background: transparent; border-radius: 9px; padding: .55rem .85rem; transition: background .15s, border-color .15s; }
.copy-button:hover { border-color: #53675d; background: rgba(255, 255, 255, .035); }
.result-qr-preview { width: 8.5rem; padding: .55rem; border-radius: 12px; background: #fff; text-align: center; }
.result-qr-preview canvas { display: block; width: 100% !important; height: auto !important; }
.result-qr-preview span { display: block; margin-top: .3rem; color: #536058; font-size: .62rem; font-weight: 700; letter-spacing: .08em; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 2.2rem 0 6rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics article { padding: 1.5rem 0; }
.metrics article + article { border-left: 1px solid var(--line); padding-left: 2rem; }
.metrics span { display: block; color: var(--muted); font-size: .74rem; margin-bottom: .5rem; }
.metrics strong { font-family: Georgia, serif; font-size: 2rem; font-weight: 400; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.4rem; }
.section-heading h2 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.search-box { width: min(21rem, 100%); position: relative; }
.search-box span { position: absolute; left: .9rem; top: 50%; transform: translateY(-53%); color: #69766f; font-size: 1.15rem; }
.search-box input { padding-left: 2.4rem; font-size: .84rem; }
.table-wrap { border-radius: var(--radius); overflow: hidden; min-height: 18rem; position: relative; }
table { width: 100%; border-collapse: collapse; }
th { color: #78867e; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; text-align: left; font-weight: 650; padding: 1rem 1.1rem; background: rgba(8, 13, 11, .35); }
td { padding: 1.15rem 1.1rem; border-top: 1px solid rgba(119, 135, 126, .13); font-size: .82rem; vertical-align: middle; }
.short-cell { min-width: 9rem; }
.short-link { color: var(--accent); font-weight: 690; text-decoration: none; }
.short-link:hover { text-decoration: underline; }
.destination { display: block; max-width: 25rem; color: #a6b2ab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.status-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .55rem; border-radius: 999px; color: #b8cbbe; background: rgba(100, 128, 112, .13); font-size: .7rem; white-space: nowrap; }
.status-pill::before { content: ""; width: .35rem; height: .35rem; background: var(--accent); border-radius: 50%; }
.status-pill.expired { color: #ac9896; }
.status-pill.expired::before { background: #a86d68; }
.clicks { font-variant-numeric: tabular-nums; font-weight: 650; }
.date { color: #7f8d85; white-space: nowrap; }
.row-actions { display: flex; gap: .25rem; justify-content: flex-end; }
.row-action { width: 2rem; height: 2rem; color: #86948c; border: 0; border-radius: 8px; background: transparent; }
.row-action:hover { color: var(--text); background: #26322d; }
.row-action.danger:hover { color: var(--danger); background: rgba(255, 133, 125, .08); }
.empty-state, .loading-state { min-height: 15rem; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-state > span { color: var(--accent); font-size: 2rem; }
.empty-state h3 { color: var(--text); margin: .8rem 0 .2rem; }
.empty-state p { margin: 0; font-size: .82rem; }
.loading-state { gap: .8rem; font-size: .78rem; }
.loading-state i { width: 1.4rem; height: 1.4rem; border: 2px solid #34433b; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .76rem; padding: 1rem .25rem; }
.pagination > div { display: flex; align-items: center; gap: .7rem; }
.pagination button { width: 2rem; height: 2rem; color: var(--text); border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); }
.pagination button:disabled { opacity: .35; cursor: default; }
footer { display: flex; justify-content: space-between; padding: 4rem 0 2rem; border-top: 1px solid rgba(142, 156, 149, .14); color: #56635c; font-size: .68rem; letter-spacing: .04em; }
.confirm-dialog, .qr-dialog { width: min(28rem, calc(100% - 2rem)); color: var(--text); border: 1px solid #35443d; border-radius: 22px; padding: 0; background: #141c19; box-shadow: 0 34px 100px rgba(0, 0, 0, .62); overflow: hidden; animation: dialog-in .18s ease-out; }
.confirm-dialog::backdrop, .qr-dialog::backdrop { background: rgba(3, 7, 5, .72); backdrop-filter: blur(7px); }
.confirm-surface { padding: 1.55rem; }
.confirm-symbol { width: 2.65rem; height: 2.65rem; display: grid; place-items: center; margin-bottom: 1.3rem; color: #ff9a92; background: rgba(255, 133, 125, .1); border: 1px solid rgba(255, 133, 125, .2); border-radius: 12px; font-size: 1.55rem; line-height: 1; }
.confirm-dialog h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.035em; }
.confirm-dialog p { margin: .75rem 0 1.6rem; color: #93a199; font-size: .86rem; line-height: 1.7; }
.confirm-dialog p strong { color: var(--accent); font-weight: 680; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.secondary-button, .danger-button, .qr-primary-button { min-height: 2.9rem; border-radius: 11px; font-weight: 700; transition: filter .15s, transform .15s; }
.secondary-button { color: #c5d0ca; border: 1px solid #35443d; background: #1a2420; }
.danger-button { color: #33100d; border: 1px solid #ff9a92; background: #ff9a92; }
.qr-primary-button { color: var(--accent-dark); border: 1px solid var(--accent); background: var(--accent); }
.secondary-button:hover, .danger-button:hover, .qr-primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.secondary-button:disabled, .danger-button:disabled, .qr-primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.qr-dialog { width: min(25rem, calc(100% - 2rem)); }
.qr-surface { position: relative; padding: 1.6rem; text-align: center; }
.modal-close { position: absolute; top: 1rem; right: 1rem; width: 2rem; height: 2rem; color: #839189; border: 0; border-radius: 8px; background: transparent; font-size: 1.2rem; }
.modal-close:hover { color: var(--text); background: #26322d; }
.qr-dialog h2 { margin: .1rem 2.2rem .35rem; font-size: 1.45rem; letter-spacing: -.035em; }
.qr-dialog-link { margin: 0 auto 1.2rem; max-width: 19rem; color: var(--accent); font-size: .79rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-canvas-frame { width: min(14rem, 100%); margin: 0 auto 1.25rem; padding: .75rem; border-radius: 15px; background: #fff; box-shadow: 0 12px 35px rgba(0, 0, 0, .25); }
.qr-canvas-frame canvas { display: block; width: 100% !important; height: auto !important; }
.qr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(.55rem) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 2rem; transform: translate(-50%, 1rem); padding: .75rem 1rem; border-radius: 10px; background: #e8f0ea; color: #152019; font-size: .8rem; font-weight: 650; box-shadow: 0 12px 30px #0008; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #ffb0aa; color: #35100d; }
.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; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .creator-secondary { grid-template-columns: 1fr 1fr; }
  .primary-button { grid-column: 1 / -1; justify-content: space-between; }
  th:nth-child(3), td:nth-child(3), th:nth-child(5), td:nth-child(5) { display: none; }
  .destination { max-width: 18rem; }
}

@media (max-width: 620px) {
  .app-shell { width: min(100% - 1.5rem, 1180px); }
  .topbar { height: 68px; }
  .status-dot { display: none; }
  main { padding-top: 4rem; }
  .hero h1 { font-size: 3.15rem; }
  .creator { padding: 1rem; }
  .creator-secondary { grid-template-columns: 1fr; }
  .primary-button { grid-column: auto; }
  .result-card { grid-template-columns: 1fr; }
  .result-qr-preview { justify-self: center; width: 9.5rem; }
  .metrics { margin-bottom: 4rem; }
  .metrics article + article { padding-left: 1rem; }
  .metrics strong { font-size: 1.55rem; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 1rem; }
  .search-box { width: 100%; }
  th:nth-child(2), td:nth-child(2) { display: none; }
  td, th { padding-left: .8rem; padding-right: .8rem; }
  .pagination { align-items: flex-start; gap: 1rem; }
  footer { flex-direction: column; gap: .4rem; }
  .confirm-actions { grid-template-columns: 1fr; }
}

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