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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;

    --success: #10b981;
    --success-light: #ecfdf5;

    --danger: #ef4444;
    --danger-light: #fef2f2;

    --text: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;

    --white: #ffffff;
    --background: #f6f7fb;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow: 0 12px 35px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.10);

    --radius: 18px;
}


/* =========================================
   BASE
========================================= */

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 50px 25px;

    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);

    background:
        radial-gradient(circle at 5% 5%,
            rgba(99, 102, 241, 0.12),
            transparent 28%),
        radial-gradient(circle at 95% 10%,
            rgba(168, 85, 247, 0.08),
            transparent 25%),
        linear-gradient(135deg,
            #f8f9fd 0%,
            #f4f6fb 100%);

    overflow-x: hidden;
}



/* =========================================
   PREMIUM TOPBAR
========================================= */

.topbar {
    width: min(1250px, 100%);
    margin: 0 auto 28px;

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

    gap: 30px;

    padding: 18px 22px;

    background: rgba(255, 255, 255, 0.88);

    border: 1px solid rgba(255, 255, 255, 0.85);

    border-radius: 18px;

    box-shadow:
        0 10px 35px rgba(15, 23, 42, 0.07);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    position: relative;

    z-index: 10;
}


/* =========================================
   TOPBAR GRADIENT LINE
========================================= */

.topbar::before {
    content: "";

    position: absolute;

    top: 0;
    left: 22px;
    right: 22px;

    height: 3px;

    border-radius: 0 0 10px 10px;

    background:
        linear-gradient(90deg,
            #6366f1,
            #8b5cf6,
            #a855f7,
            #6366f1);

    background-size: 200% 100%;

    animation: topbarGradient 5s linear infinite;
}

@keyframes topbarGradient {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}


/* =========================================
   BRAND / TITLE AREA
========================================= */

.topbar>div:first-child {
    min-width: 0;
}

.topbar h1 {
    margin: 0;

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

    color: #111827;

    font-size: 20px;

    font-weight: 800;

    letter-spacing: -0.04em;

    line-height: 1.2;
}


/* Logo icon before title */

.topbar h1::before {
    content: "✓";

    display: inline-flex;

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

    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    color: white;

    border-radius: 10px;

    font-size: 16px;
    font-weight: 800;

    background:
        linear-gradient(135deg,
            #6366f1,
            #7c3aed);

    box-shadow:
        0 6px 15px rgba(99, 102, 241, 0.25);
}


/* Description */

.topbar p {
    margin: 6px 0 0 44px;

    color: #8a93a4;

    font-size: 11px;

    font-weight: 450;

    line-height: 1.4;
}


/* =========================================
   NAVIGATION
========================================= */

.topbar .nav {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 5px;

    flex-shrink: 0;
}


/* =========================================
   NAV LINKS
========================================= */

.topbar .nav a {
    position: relative;

    display: inline-flex;

    align-items: center;

    min-height: 38px;

    padding: 0 13px;

    color: #697386;

    text-decoration: none;

    border-radius: 9px;

    font-size: 12px;

    font-weight: 600;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.topbar .nav a:hover {
    color: #4f46e5;

    background: #f2f3ff;

    transform: translateY(-1px);
}


/* Active-ish underline */

.topbar .nav a:first-of-type {
    color: #4f46e5;

    background:
        linear-gradient(135deg,
            #eef2ff,
            #f5f3ff);
}

.topbar .nav a:first-of-type::after {
    content: "";

    position: absolute;

    left: 13px;
    right: 13px;

    bottom: 4px;

    height: 2px;

    border-radius: 10px;

    background: #6366f1;
}


/* =========================================
   USER BADGE
========================================= */

.topbar .user {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    height: 38px;

    padding: 0 12px 0 8px;

    color: #374151;

    background: #f8f9fc;

    border: 1px solid #e9ebf1;

    border-radius: 10px;

    font-size: 11px;

    font-weight: 650;

    white-space: nowrap;
}


/* User avatar */

.topbar .user::before {
    content: "T";

    display: inline-flex;

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

    width: 25px;
    height: 25px;

    color: white;

    background:
        linear-gradient(135deg,
            #6366f1,
            #8b5cf6);

    border-radius: 7px;

    font-size: 10px;

    font-weight: 750;

    box-shadow:
        0 3px 8px rgba(99, 102, 241, 0.22);
}


/* =========================================
   LOGOUT FORM
========================================= */

.topbar .nav form {
    display: inline-flex;

    margin: 0;
}


/* =========================================
   LOGOUT BUTTON
========================================= */

.topbar .nav form button {
    position: relative;

    display: inline-flex;

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

    height: 38px;

    padding: 0 13px;

    color: #dc3545;

    background: #fff5f5;

    border: 1px solid #ffe0e0;

    border-radius: 9px;

    font-family: inherit;

    font-size: 11px;

    font-weight: 650;

    cursor: pointer;

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

.topbar .nav form button:hover {
    color: #c82333;

    background: #ffebed;

    border-color: #ffcdd2;

    transform: translateY(-1px);
}


/* =========================================
   SEPARATOR
========================================= */

.topbar .user {
    margin-right: 5px;
}

.topbar .nav a:first-of-type {
    margin-left: 3px;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 850px) {

    .topbar {
        align-items: flex-start;

        flex-direction: column;

        gap: 17px;

        padding: 21px;
    }

    .topbar .nav {
        width: 100%;

        justify-content: flex-start;

        flex-wrap: wrap;
    }

    .topbar p {
        margin-left: 44px;
    }
}


@media (max-width: 550px) {

    .topbar {
        margin-bottom: 18px;

        border-radius: 15px;
    }

    .topbar h1 {
        font-size: 18px;
    }

    .topbar h1::before {
        width: 31px;
        height: 31px;

        flex-basis: 31px;
    }

    .topbar p {
        margin-left: 41px;

        max-width: 280px;

        font-size: 10px;
    }

    .topbar .nav {
        display: grid;

        grid-template-columns: auto 1fr 1fr;

        width: 100%;

        gap: 6px;
    }

    .topbar .user,
    .topbar .nav a,
    .topbar .nav form,
    .topbar .nav form button {
        width: 100%;
    }

    .topbar .nav a,
    .topbar .nav form button,
    .topbar .user {
        justify-content: center;

        padding-left: 8px;
        padding-right: 8px;
    }

    .topbar .nav a:first-of-type::after {
        display: none;
    }
}








/* =========================================
   MAIN GRID
========================================= */

.grid {
    width: min(1250px, 100%);
    margin: auto;

    display: grid;

    grid-template-columns:
        minmax(0, 390px) minmax(0, 1fr);

    gap: 28px;

    align-items: start;

    min-width: 0;
}


/* =========================================
   CARDS
========================================= */

.card {
    position: relative;

    min-width: 0;

    background: rgba(255, 255, 255, 0.88);

    border: 1px solid rgba(255, 255, 255, 0.8);

    border-radius: var(--radius);

    padding: 30px;

    box-shadow: var(--shadow);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    /*
     * IMPORTANT:
     * Don't use overflow:hidden here.
     * It can interfere with the table scrolling.
     */
    overflow: visible;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;
    right: 0;

    height: 4px;

    border-radius: var(--radius) var(--radius) 0 0;

    background:
        linear-gradient(90deg,
            #6366f1,
            #8b5cf6,
            #a855f7);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}


/* =========================================
   CARD HEADINGS
========================================= */

.card h2 {
    position: relative;

    margin: 0 0 26px;

    font-size: 21px;

    font-weight: 750;

    letter-spacing: -0.035em;

    color: #111827;
}

.card h2::after {
    content: "";

    display: block;

    width: 32px;
    height: 3px;

    margin-top: 9px;

    border-radius: 10px;

    background:
        linear-gradient(90deg,
            var(--primary),
            #a855f7);
}


/* =========================================
   FORM
========================================= */

.card form {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.card label {
    margin-bottom: 7px;

    color: #374151;

    font-size: 12px;

    font-weight: 650;

    letter-spacing: 0.01em;
}

.card input,
.card select,
.card textarea {
    width: 100%;

    margin-bottom: 17px;

    padding: 12px 14px;

    color: #1f2937;

    background: #fafbff;

    border: 1px solid #e2e6ef;

    border-radius: 10px;

    outline: none;

    font-family: inherit;

    font-size: 13px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        transform 0.15s ease;
}

.card input,
.card select {
    height: 44px;
}

.card textarea {
    min-height: 95px;

    resize: vertical;
}


/* =========================================
   PLACEHOLDER
========================================= */

.card input::placeholder,
.card textarea::placeholder {
    color: #a1a8b5;
}


/* =========================================
   INPUT FOCUS
========================================= */

.card input:focus,
.card select:focus,
.card textarea:focus {
    background: #fff;

    border-color: var(--primary);

    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.10),
        0 4px 12px rgba(99, 102, 241, 0.06);
}


/* =========================================
   SELECT
========================================= */

.card select {
    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    background-image:
        linear-gradient(45deg,
            transparent 50%,
            #8b93a5 50%),
        linear-gradient(135deg,
            #8b93a5 50%,
            transparent 50%);

    background-position:
        calc(100% - 17px) 18px,
        calc(100% - 12px) 18px;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;
}


/* =========================================
   HELPER TEXT
========================================= */

.card small {
    color: #8a93a4;

    font-size: 11px;
}

input[name="license_key"]+small {
    display: block;

    margin-top: -10px;
    margin-bottom: 18px;
}


/* =========================================
   PRIMARY BUTTON
========================================= */

button {
    border: none;

    outline: none;

    font-family: inherit;

    font-weight: 650;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

button.primary {
    position: relative;

    width: 100%;
    height: 46px;

    margin-top: 4px;

    overflow: hidden;

    color: white;

    border-radius: 10px;

    background:
        linear-gradient(135deg,
            #6366f1 0%,
            #584ee8 50%,
            #7c3aed 100%);

    box-shadow:
        0 8px 20px rgba(99, 102, 241, 0.25);
}

button.primary::before {
    content: "";

    position: absolute;

    top: 0;
    left: -100%;

    width: 60%;
    height: 100%;

    background:
        linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.20),
            transparent);

    transform: skewX(-20deg);

    transition: left 0.5s ease;
}

button.primary:hover::before {
    left: 140%;
}

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

    box-shadow:
        0 12px 25px rgba(99, 102, 241, 0.32);
}

button.primary:active {
    transform: translateY(0);
}


/* =========================================
   TABLE WRAPPER
   IMPORTANT: SCROLL GOES HERE
========================================= */

.table-wrap {
    width: 100%;

    max-width: 100%;

    min-width: 0;

    /*
     * Horizontal + vertical scrolling
     */
    overflow-x: auto;
    overflow-y: auto;

    /*
     * Smooth scrolling on phones
     */
    -webkit-overflow-scrolling: touch;

    /*
     * Prevent scroll chaining
     */
    overscroll-behavior: contain;

    border: 1px solid #e7eaf0;

    border-radius: 14px;

    background: #ffffff;

    box-shadow: var(--shadow-sm);

    /*
     * Nice scrollbar
     */
    scrollbar-width: thin;

    scrollbar-color:
        #cbd1dc #f4f5f8;
}


/* =========================================
   TABLE SCROLLBAR - CHROME / EDGE / SAFARI
========================================= */

.table-wrap::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.table-wrap::-webkit-scrollbar-track {
    background: #f4f5f8;

    border-radius: 10px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: #cbd1dc;

    border-radius: 10px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
    background: #aeb6c5;
}


/* =========================================
   TABLE
========================================= */

table {
    /*
     * IMPORTANT:
     * Do NOT put overflow-x:auto on table.
     * .table-wrap handles the scrolling.
     */

    width: 100%;

    /*
     * Forces horizontal scrolling when
     * the available space is smaller.
     */
    min-width: 700px;

    border-collapse: separate;

    border-spacing: 0;

    background: white;
}


/* =========================================
   TABLE HEADER
========================================= */

thead {
    background:
        linear-gradient(180deg,
            #fafbff,
            #f7f8fc);
}

th {
    padding: 14px 17px;

    color: #7a8393;

    border-bottom: 1px solid #e8ebf1;

    font-size: 10px;

    font-weight: 750;

    text-align: left;

    text-transform: uppercase;

    letter-spacing: 0.075em;

    white-space: nowrap;
}


/* =========================================
   TABLE CELLS
========================================= */

td {
    padding: 17px;

    color: #374151;

    border-bottom: 1px solid #eef0f4;

    font-size: 12px;

    vertical-align: middle;

    white-space: nowrap;
}

tbody tr {
    transition:
        background 0.18s ease;
}


/*
 * IMPORTANT:
 * Remove overflow-x from tr.
 */
tbody tr:hover {
    background: #fafbff;
}

tbody tr:last-child td {
    border-bottom: none;
}


/* =========================================
   LICENSE KEY
========================================= */

td code {
    display: inline-flex;

    align-items: center;

    padding: 7px 10px;

    color: #5658c7;

    background:
        linear-gradient(135deg,
            #f0f1ff,
            #f6f3ff);

    border: 1px solid #e5e5ff;

    border-radius: 7px;

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 11px;

    font-weight: 650;

    letter-spacing: 0.05em;
}


/* =========================================
   BUYER INFORMATION
========================================= */

td:nth-child(2) {
    color: #202738;

    font-weight: 600;
}

td:nth-child(2) small {
    display: block;

    margin-top: 3px;

    color: #929aaa;

    font-size: 10px;

    font-weight: 400;
}


/* =========================================
   LICENSE TYPE
========================================= */

td:nth-child(3) {
    color: #5b6475;

    font-weight: 600;
}


/* =========================================
   INSTALLS
========================================= */

td:nth-child(4) {
    color: #555f70;

    font-weight: 600;
}


/* =========================================
   STATUS
========================================= */

td:nth-child(5) {
    color: var(--success);

    font-weight: 700;
}

td:nth-child(5)::before {
    content: "";

    display: inline-block;

    width: 7px;
    height: 7px;

    margin-right: 8px;

    background: var(--success);

    border-radius: 50%;

    box-shadow:
        0 0 0 4px rgba(16, 185, 129, 0.10);

    vertical-align: 1px;
}


/* =========================================
   ACTIONS
========================================= */

.actions {
    display: flex;

    align-items: center;

    gap: 7px;
}

.actions form {
    display: inline-flex;

    margin: 0;
}

.actions button {
    padding: 7px 11px;

    color: #667085;

    background: #f7f8fa;

    border: 1px solid #e5e7eb;

    border-radius: 7px;

    font-size: 10px;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.actions button:hover {
    color: #344054;

    background: #eef0f4;

    border-color: #d9dde5;

    transform: translateY(-1px);
}


/* =========================================
   DELETE BUTTON
========================================= */

.actions button.danger {
    color: #dc3545;

    background: #fff5f5;

    border-color: #ffe0e0;
}

.actions button.danger:hover {
    color: #c82333;

    background: #ffebed;

    border-color: #ffcdd2;
}


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

@media (max-width: 1000px) {

    body {
        padding: 30px 18px;
    }

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

        width: 100%;
    }

    .card:first-child {
        max-width: 650px;
    }
}


@media (max-width: 650px) {

    body {
        padding: 18px 10px;
    }

    .grid {
        gap: 18px;
    }

    .card {
        padding: 21px;

        border-radius: 15px;
    }

    .card h2 {
        font-size: 19px;
    }

    /*
     * The table can now scroll horizontally
     * inside the card on mobile.
     */
    .table-wrap {
        width: 100%;

        max-width: 100%;

        overflow-x: auto;
        overflow-y: auto;

        border-radius: 11px;
    }

    table {
        min-width: 700px;
    }

    .actions {
        flex-direction: row;
    }
}


/* =========================================
   SUBTLE ENTRY ANIMATION
========================================= */

.card {
    animation:
        cardIn 0.45s ease both;
}

.card:nth-child(2) {
    animation-delay: 0.08s;
}

@keyframes cardIn {

    from {
        opacity: 0;

        transform:
            translateY(10px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}