
:root {
    --purple: #7e7fff;
    --purple-dark: #6263df;
    --purple-soft: #eeeeff;

    --yellow: #fffe7e;
    --pink: #ff7ec0;
    --green: #7effbe;

    --background: #f7f7fc;
    --background-2: #fbfbff;

    --surface: #ffffff;
    --surface-soft: #fafaff;
    --surface-purple: #f5f4ff;

    --text: #191925;
    --text-soft: #5e6072;
    --muted: #8a8c9e;

    --border: #e7e7f0;
    --border-strong: #dcdcea;

    --shadow:
        0 22px 65px rgba(65,65,110,.10);

    --shadow-small:
        0 9px 28px rgba(65,65,110,.07);

    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    color-scheme: light;
    background: #f7f7fc;
}

body {
    margin: 0;
    min-height: 100vh;

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background:
        radial-gradient(
            circle at 8% 5%,
            rgba(126,127,255,.15),
            transparent 30%
        ),
        radial-gradient(
            circle at 92% 88%,
            rgba(255,126,192,.10),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            #ffffff 0%,
            #f7f7fc 100%
        );
}

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    background-image:
        linear-gradient(
            rgba(126,127,255,.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(126,127,255,.035) 1px,
            transparent 1px
        );

    background-size:
        44px 44px;

    mask-image:
        linear-gradient(
            to bottom,
            black,
            transparent 90%
        );

    z-index: -3;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

.background-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(120px);
    pointer-events: none;
    opacity: .16;
    z-index: -2;
}

.orb-one {
    width: 430px;
    height: 430px;
    background: var(--purple);
    top: -230px;
    right: -110px;
}

.orb-two {
    width: 350px;
    height: 350px;
    background: var(--pink);
    left: -160px;
    bottom: 5%;
}


/* =========================================================
   TOP BAR / BRANDING
   ========================================================= */

.topbar {
    min-height: 82px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 16px 5%;

    border-bottom:
        1px solid
        rgba(126,127,255,.10);

    background:
        rgba(255,255,255,.78);

    backdrop-filter:
        blur(22px);

    position: sticky;
    top: 0;

    z-index: 20;
}

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

.brand-icon {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--purple),
            #9e7dff
        );

    border-radius: 14px;

    font-size: 18px;
    font-weight: 900;

    box-shadow:
        0 10px 25px
        rgba(126,127,255,.22);
}

.brand div:last-child {
    display: flex;
    flex-direction: column;
}

.brand strong {
    font-size: 16px;
    color: var(--text);
}

.brand span {
    font-size: 12px;
    color: var(--muted);
}

.header-status {
    font-size: 12px;
    color: var(--text-soft);

    display: flex;
    align-items: center;
    gap: 9px;

    padding: 9px 12px;

    border:
        1px solid
        var(--border);

    border-radius: 999px;

    background:
        rgba(255,255,255,.78);

    box-shadow:
        var(--shadow-small);
}

.status-dot {
    width: 8px;
    height: 8px;

    border-radius: 100%;

    background: var(--green);

    box-shadow:
        0 0 0 5px
        rgba(126,255,190,.18);
}


/* =========================================================
   GENERIC LAYOUT
   ========================================================= */

.container {
    width: min(1420px, 92%);
    margin: 0 auto;
}

.hero {
    min-height: 335px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 36px;
}

.eyebrow {
    display: block;

    font-size: 11px;
    letter-spacing: .18em;

    color: var(--purple-dark);

    font-weight: 850;

    margin-bottom: 11px;
}

.hero h1 {
    font-size:
        clamp(42px, 5vw, 72px);

    line-height: .98;
    letter-spacing: -.055em;

    margin: 0 0 20px;
}

.hero h1 span {
    color: var(--purple);
}

.hero p {
    color: var(--text-soft);

    max-width: 650px;

    font-size: 17px;

    line-height: 1.75;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    border: 0;

    min-height: 46px;

    padding: 13px 22px;

    border-radius: 13px;

    color: white;

    font-weight: 780;

    background:
        linear-gradient(
            135deg,
            var(--purple),
            #946fff
        );

    box-shadow:
        0 12px 30px
        rgba(126,127,255,.22);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.primary-button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 17px 35px
        rgba(126,127,255,.28);
}

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


/* =========================================================
   STATS
   ========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 16px;

    margin-bottom: 25px;
}

.stat-card {
    position: relative;

    overflow: hidden;

    border:
        1px solid
        var(--border);

    background:
        rgba(255,255,255,.92);

    border-radius: 20px;

    padding: 26px;

    box-shadow:
        var(--shadow-small);
}

.stat-card::before {
    content: "";

    position: absolute;

    width: 95px;
    height: 95px;

    border-radius: 50%;

    right: -45px;
    top: -45px;

    background:
        rgba(126,127,255,.08);
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.stat-card strong {
    display: block;

    color: var(--text);

    font-size: 34px;

    margin-top: 9px;
}


/* =========================================================
   MAIN PANEL
   ========================================================= */

.panel {
    border:
        1px solid
        var(--border);

    border-radius: 24px;

    background:
        rgba(255,255,255,.92);

    box-shadow:
        var(--shadow);

    overflow: hidden;

    margin-bottom: 80px;
}

.panel-header {
    padding: 26px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-bottom:
        1px solid
        var(--border);

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #fcfcff
        );
}

.panel-header h2 {
    margin: 0;

    font-size: 25px;

    letter-spacing: -.025em;
}

.search-wrapper input {
    width: 290px;

    border:
        1px solid
        var(--border);

    border-radius: 12px;

    color: var(--text);

    background: #ffffff;

    outline: none;

    padding: 12px 15px;

    box-shadow:
        inset 0 0 0 1px
        rgba(126,127,255,.01);

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.search-wrapper input::placeholder {
    color: #a5a6b5;
}

.search-wrapper input:focus {
    border-color:
        rgba(126,127,255,.65);

    box-shadow:
        0 0 0 4px
        rgba(126,127,255,.10);
}


/* =========================================================
   LINK LIST
   ========================================================= */

.link-list {
    padding: 13px;
}

.link-card {
    display: grid;

    grid-template-columns:
        minmax(300px, 1fr)
        auto
        auto;

    gap: 27px;

    align-items: center;

    padding: 19px;

    border-radius: 17px;

    transition:
        background .2s ease,
        transform .2s ease;
}

.link-card:hover {
    background:
        rgba(126,127,255,.035);

    transform:
        translateY(-1px);
}

.link-card + .link-card {
    border-top:
        1px solid
        var(--border);
}

.link-main {
    display: flex;

    align-items: center;

    min-width: 0;

    gap: 15px;
}

.link-icon {
    width: 48px;
    height: 48px;

    min-width: 48px;

    display: grid;

    place-items: center;

    background:
        rgba(126,127,255,.12);

    color: var(--purple-dark);

    border-radius: 14px;

    font-size: 18px;
}

.link-information {
    min-width: 0;
}

.link-title-row {
    display: flex;
    align-items: center;

    gap: 9px;

    flex-wrap: wrap;
}

.link-title-row h3 {
    font-size: 16px;

    color: var(--text);

    margin: 0;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.badge {
    display: inline-flex;
    align-items: center;

    font-size: 9px;

    text-transform: uppercase;

    letter-spacing: .08em;

    font-weight: 850;

    padding: 5px 8px;

    border-radius: 99px;
}

.badge.active {
    color: #25744f;

    background:
        rgba(126,255,190,.22);
}

.badge.disabled {
    color: #747687;

    background:
        #f0f0f5;
}

.badge.expired {
    color: #b84f84;

    background:
        rgba(255,126,192,.15);
}

.badge.published {
    color: #25744f;

    background:
        rgba(126,255,190,.22);
}

.badge.private {
    color: #67697a;

    background:
        #f0f0f5;
}

.short-link {
    margin-top: 6px;

    color: var(--purple-dark);

    font-size: 13px;

    font-weight: 650;
}

.copy-small {
    background: none;

    border: 0;

    color: var(--muted);

    font-size: 10px;

    padding: 3px 6px;
}

.copy-small:hover {
    color: var(--purple-dark);
}

.destination {
    font-size: 12px;

    color: var(--muted);

    margin-top: 5px;

    white-space: nowrap;

    max-width: 620px;

    overflow: hidden;

    text-overflow: ellipsis;
}

.link-meta {
    display: flex;

    gap: 28px;
}

.link-meta div {
    min-width: 74px;
}

.link-meta span {
    display: block;

    color: var(--muted);

    font-size: 10px;
    font-weight: 700;
}

.link-meta strong {
    display: block;

    color: var(--text);

    font-size: 14px;

    margin-top: 5px;
}

.link-actions {
    display: flex;

    gap: 6px;

    flex-wrap: wrap;

    justify-content: flex-end;
}

.action-button {
    text-decoration: none;

    border:
        1px solid
        var(--border);

    background: #ffffff;

    color: var(--text-soft);

    border-radius: 9px;

    padding: 9px 11px;

    font-size: 11px;
    font-weight: 700;

    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease,
        transform .2s ease;
}

.action-button:hover {
    color: var(--purple-dark);

    background:
        var(--purple-soft);

    border-color:
        rgba(126,127,255,.28);

    transform:
        translateY(-1px);
}

.action-button.danger:hover {
    color: #bd4668;

    background:
        rgba(255,126,192,.10);

    border-color:
        rgba(255,126,192,.25);
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 78px 30px;

    text-align: center;
}

.empty-icon {
    width: 64px;
    height: 64px;

    margin: 0 auto 17px;

    display: grid;
    place-items: center;

    border-radius: 18px;

    background:
        var(--purple-soft);

    font-size: 30px;
}

.empty-state h3 {
    margin:
        0 0 7px;

    font-size: 22px;
}

.empty-state p {
    color: var(--muted);

    margin:
        0 0 22px;
}


/* =========================================================
   MODALS
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;

    z-index: 100;

    display: none;

    place-items: center;

    padding: 18px;
}

.modal.open {
    display: grid;
}

.modal-backdrop {
    position: absolute;
    inset: 0;

    background:
        rgba(35,35,55,.24);

    backdrop-filter:
        blur(10px);
}

.modal-content {
    position: relative;

    z-index: 2;

    width:
        min(650px, 96%);

    max-height: 90vh;

    overflow-y: auto;

    padding: 30px;

    background:
        rgba(255,255,255,.98);

    border:
        1px solid
        var(--border);

    border-radius: 25px;

    box-shadow:
        0 35px 100px
        rgba(45,45,80,.18);
}

.modal-header {
    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 20px;

    margin-bottom: 26px;
}

.modal-header h2 {
    margin: 0;

    font-size: 26px;

    letter-spacing: -.025em;
}

.close-button {
    width: 38px;
    height: 38px;

    border:
        1px solid
        var(--border);

    border-radius: 11px;

    background: #fff;

    color: var(--muted);

    font-size: 23px;

    line-height: 1;
}

.close-button:hover {
    color: var(--purple-dark);

    background:
        var(--purple-soft);
}


/* =========================================================
   FORMS
   ========================================================= */

form label {
    display: block;

    color: var(--text-soft);

    font-size: 13px;
    font-weight: 700;

    margin-bottom: 18px;
}

form input {
    width: 100%;

    margin-top: 8px;

    padding: 13px 14px;

    background: #fff;

    color: var(--text);

    border:
        1px solid
        var(--border);

    border-radius: 11px;

    outline: 0;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

form input::placeholder {
    color: #a7a8b8;
}

form input:focus {
    border-color:
        rgba(126,127,255,.68);

    box-shadow:
        0 0 0 4px
        rgba(126,127,255,.10);
}

form small {
    color: var(--muted);

    display: block;

    margin-top: 7px;

    line-height: 1.5;
}

.short-code-input {
    display: flex;

    align-items: center;

    margin-top: 8px;

    background: #fff;

    border:
        1px solid
        var(--border);

    border-radius: 11px;

    overflow: hidden;
}

.short-code-input:focus-within {
    border-color:
        rgba(126,127,255,.68);

    box-shadow:
        0 0 0 4px
        rgba(126,127,255,.10);
}

.short-code-input span {
    color: var(--muted);

    padding-left: 13px;

    font-size: 12px;
}

.short-code-input input {
    margin: 0;
    border: 0;
    box-shadow: none !important;
}

.section-divider {
    display: flex;

    align-items: center;

    gap: 10px;

    color: var(--muted);

    font-size: 10px;

    text-transform: uppercase;

    letter-spacing: .12em;

    margin: 26px 0;
}

.section-divider::after {
    content: "";

    height: 1px;

    background: var(--border);

    flex: 1;
}

.three-column {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 11px;
}

.form-message {
    display: none;

    font-size: 12px;

    padding: 11px;

    border-radius: 9px;

    margin-bottom: 9px;
}

.form-message.error {
    display: block;

    color: #b84768;

    background:
        rgba(255,126,192,.11);
}

.form-message.success {
    display: block;

    color: #26714f;

    background:
        rgba(126,255,190,.18);
}


/* =========================================================
   QR MODAL
   ========================================================= */

.qr-modal {
    max-width: 410px;

    text-align: center;
}

.qr-modal img {
    width: 270px;
    height: 270px;

    border-radius: 16px;

    background: white;

    padding: 12px;

    border:
        1px solid
        var(--border);

    box-shadow:
        var(--shadow-small);
}

.qr-modal p {
    word-break: break-all;

    color: var(--text-soft);

    font-size: 12px;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    border-top:
        1px solid
        var(--border);

    padding: 31px 5%;

    display: flex;

    justify-content: space-between;

    gap: 18px;

    color: var(--muted);

    font-size: 12px;

    background:
        rgba(255,255,255,.55);
}

footer div {
    display: flex;

    gap: 16px;

    align-items: center;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media(max-width: 1000px) {

    .link-card {
        grid-template-columns: 1fr;
    }

    .link-meta,
    .link-actions {
        margin-left: 63px;
    }

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

}

@media(max-width: 700px) {

    .topbar {
        min-height: 72px;
        padding: 12px 4%;
    }

    .hero {
        min-height: 300px;

        align-items: flex-start;

        flex-direction: column;

        justify-content: center;
    }

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

    .panel-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 16px;
    }

    .search-wrapper,
    .search-wrapper input {
        width: 100%;
    }

    .three-column {
        grid-template-columns: 1fr;
    }

    .header-status {
        font-size: 0;
        padding: 10px;
    }

    .header-status .status-dot {
        margin: 0;
    }

    .link-meta,
    .link-actions {
        margin-left: 0;
    }

    footer {
        flex-direction: column;

        gap: 16px;
    }
}


/* =========================================================
   LIGHT THEME SAFETY OVERRIDES
   ========================================================= */

html,
body {
    background-color: #f7f7fc !important;
    color: #191925 !important;
    color-scheme: light !important;
}

body {
    background:
        radial-gradient(circle at 8% 5%, rgba(126,127,255,.15), transparent 30%),
        radial-gradient(circle at 92% 88%, rgba(255,126,192,.10), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f7f7fc 100%) !important;
}

.topbar,
.panel,
.stat-card,
.modal-content {
    background-color: #ffffff !important;
}

h1,
h2,
h3,
strong {
    color: #191925;
}

.hero p,
.destination,
.link-meta span,
footer,
.brand span {
    color: #8a8c9e;
}


/* V8 Advanced Management additions */
.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

select,
textarea {
    font: inherit;
}

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

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