* {
    box-sizing: border-box;
}

:root {
    --bg: #020711;
    --bg-deep: #01040a;
    --panel: rgba(7, 22, 40, 0.94);
    --panel-soft: rgba(10, 30, 52, 0.82);
    --panel-dark: rgba(2, 13, 25, 0.94);
    --gold: #dcae4e;
    --gold-bright: #f5db87;
    --gold-soft: rgba(220, 174, 78, 0.12);
    --blue: #43a6df;
    --text: #f5f8fb;
    --muted: #91a4b8;
    --green: #48df86;
    --red: #ff7181;
    --warning: #f5bd4d;
    --line: rgba(220, 174, 78, 0.24);
    --blue-line: rgba(67, 166, 223, 0.20);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(20, 103, 164, 0.23),
            transparent 31%
        ),
        radial-gradient(
            circle at 85% 13%,
            rgba(220, 174, 78, 0.10),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            var(--bg),
            var(--bg-deep)
        );
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.admin-background-grid {
    position: fixed;
    inset: 0;
    z-index: -3;
    opacity: 0.28;
    pointer-events: none;
    background-image:
        linear-gradient(
            rgba(67, 166, 223, 0.055) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(67, 166, 223, 0.055) 1px,
            transparent 1px
        );
    background-size: 58px 58px;
}

.admin-orb {
    position: fixed;
    z-index: -2;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
}

.admin-orb-one {
    top: 15%;
    left: -180px;
    width: 420px;
    height: 420px;
    background: rgba(22, 115, 180, 0.15);
}

.admin-orb-two {
    top: 40%;
    right: -210px;
    width: 460px;
    height: 460px;
    background: rgba(220, 174, 78, 0.08);
}

/* LOGIN */

.admin-login-body {
    display: grid;
    place-items: center;
    padding: 28px;
}

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

.login-card {
    position: relative;
    padding: 38px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    background:
        linear-gradient(
            145deg,
            rgba(15, 34, 58, 0.98),
            rgba(4, 13, 25, 0.98)
        );
    box-shadow:
        0 35px 90px rgba(0, 0, 0, 0.46),
        0 0 45px rgba(220, 174, 78, 0.06);
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 12%;
    left: 12%;
    height: 1px;
    background:
        linear-gradient(
            90deg,
            transparent,
            var(--gold-bright),
            transparent
        );
    box-shadow:
        0 0 20px
        rgba(245, 219, 135, 0.75);
}

.login-card > .admin-kicker {
    margin-top: 34px;
}

.login-card h1 {
    margin: 10px 0;
    font-size: 2.25rem;
}

.login-card > p {
    color: var(--muted);
    line-height: 1.65;
}

.login-card form {
    margin-top: 26px;
    display: grid;
    gap: 20px;
}

.back-link {
    display: inline-block;
    margin-top: 24px;
    color: var(--muted);
}

/* HEADER */

.admin-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 84px;
    padding: 10px clamp(18px, 4vw, 66px);
    display: grid;
    grid-template-columns:
        minmax(240px, auto)
        1fr
        auto;
    align-items: center;
    gap: 25px;
    border-bottom: 1px solid var(--line);
    background:
        rgba(2, 8, 17, 0.86);
    backdrop-filter: blur(22px);
    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.20);
}

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

.admin-brand img {
    width: 55px;
    height: 55px;
    object-fit: contain;
    filter:
        drop-shadow(
            0 0 16px
            rgba(220, 174, 78, 0.34)
        );
}

.admin-brand strong {
    display: block;
    color: var(--gold-bright);
    font-family: "Manrope", sans-serif;
    font-size: 1.55rem;
    letter-spacing: 0.08em;
}

.admin-brand span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.63rem;
    letter-spacing: 0.20em;
}

.admin-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.nav-link {
    position: relative;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.80rem;
    font-weight: 800;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold-bright);
    background: var(--gold-soft);
    transform: translateY(-1px);
}

.nav-count {
    min-width: 20px;
    min-height: 20px;
    margin-left: 5px;
    padding: 2px 5px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--red);
    color: white;
    font-size: 0.62rem;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.website-link {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.website-link:hover {
    color: var(--gold-bright);
}

.logout-button {
    min-height: 40px;
    padding: 0 14px;
    color: #ffc2c9;
    border: 1px solid
        rgba(255, 113, 129, 0.30);
    border-radius: 9px;
    background:
        rgba(255, 113, 129, 0.07);
}

/* MAIN */

.admin-main {
    width: min(1460px, calc(100% - 38px));
    margin: 0 auto;
    padding: 46px 0 80px;
}

.admin-hero {
    margin-bottom: 27px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.admin-heading {
    max-width: 780px;
}

.admin-kicker {
    display: inline-block;
    color: var(--gold);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.admin-heading h1 {
    margin: 9px 0 9px;
    font-family: "Manrope", sans-serif;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1.08;
}

.admin-heading h1 strong {
    display: block;
    color: transparent;
    background:
        linear-gradient(
            135deg,
            #fff1b2,
            #dcae4e,
            #fff0a6
        );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    animation:
        goldTextFlow 5s linear infinite;
}

.admin-heading p,
.panel-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.system-live-card {
    min-width: 250px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid
        rgba(72, 223, 134, 0.24);
    border-radius: 14px;
    background:
        rgba(72, 223, 134, 0.06);
}

.live-dot {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--green);
    box-shadow:
        0 0 0 6px
        rgba(72, 223, 134, 0.10),
        0 0 18px
        rgba(72, 223, 134, 0.75);
    animation:
        livePulse 1.8s ease-in-out infinite;
}

.system-live-card small,
.system-live-card strong {
    display: block;
}

.system-live-card small {
    color: var(--muted);
    font-size: 0.60rem;
    letter-spacing: 0.10em;
}

.system-live-card strong {
    margin-top: 4px;
    color: #9ef0bf;
    font-size: 0.74rem;
}

/* ALERTS */

.admin-alert {
    margin: 17px 0;
    padding: 14px 17px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 11px;
    font-size: 0.86rem;
}

.admin-alert > span {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    font-weight: 900;
}

.admin-alert.success {
    color: #a9f2ca;
    border: 1px solid
        rgba(72, 223, 134, 0.25);
    background:
        rgba(72, 223, 134, 0.08);
}

.admin-alert.success > span {
    background:
        rgba(72, 223, 134, 0.15);
}

.admin-alert.error {
    color: #ffc2c9;
    border: 1px solid
        rgba(255, 113, 129, 0.26);
    background:
        rgba(255, 113, 129, 0.08);
}

.admin-alert.error > span {
    background:
        rgba(255, 113, 129, 0.15);
}

/* STAT CARDS */

.stat-grid {
    margin-bottom: 22px;
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.stat-card {
    position: relative;
    min-height: 135px;
    padding: 21px;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: hidden;
    border: 1px solid
        rgba(148, 162, 181, 0.14);
    border-radius: 18px;
    background:
        linear-gradient(
            145deg,
            rgba(10, 30, 52, 0.92),
            rgba(3, 15, 28, 0.94)
        );
    box-shadow:
        0 23px 55px
        rgba(0, 0, 0, 0.18);
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: -110%;
    left: -50%;
    width: 38%;
    height: 300%;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent
        );
    transform: rotate(17deg);
    animation:
        cardShine 8s ease-in-out infinite;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color:
        rgba(220, 174, 78, 0.34);
    box-shadow:
        0 28px 65px
        rgba(0, 0, 0, 0.26),
        0 0 28px
        rgba(220, 174, 78, 0.06);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--gold-soft);
    color: var(--gold-bright);
    font-size: 1.3rem;
    font-weight: 900;
}

.stat-card span,
.stat-card strong,
.stat-card small {
    display: block;
}

.stat-card span {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-card strong {
    margin-top: 7px;
    color: var(--gold-bright);
    font-family: "Manrope", sans-serif;
    font-size: 1.72rem;
}

.stat-card small {
    margin-top: 4px;
    color: #72879b;
    font-size: 0.64rem;
}

.revenue-card {
    border-color:
        rgba(220, 174, 78, 0.25);
}

/* COMMERCIAL ACTIONS */

.commercial-actions-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.commercial-action-card {
    position: relative;
    min-height: 320px;
    padding: 28px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        linear-gradient(
            145deg,
            rgba(8, 29, 50, 0.96),
            rgba(2, 13, 25, 0.98)
        );
    box-shadow:
        0 28px 70px
        rgba(0, 0, 0, 0.24);
    transition:
        transform 0.24s ease,
        box-shadow 0.24s ease;
}

.commercial-action-card::after {
    content: "";
    position: absolute;
    right: -100px;
    bottom: -130px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background:
        rgba(220, 174, 78, 0.07);
    filter: blur(15px);
}

.commercial-action-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 36px 85px
        rgba(0, 0, 0, 0.31),
        0 0 35px
        rgba(220, 174, 78, 0.08);
}

.action-topline {
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.action-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--gold-soft);
    font-size: 1.35rem;
}

.attention-badge,
.clear-badge,
.gold-badge {
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
}

.attention-badge {
    color: #ffe2a3;
    border: 1px solid
        rgba(245, 189, 77, 0.28);
    background:
        rgba(245, 189, 77, 0.09);
}

.clear-badge {
    color: #a6efc4;
    border: 1px solid
        rgba(72, 223, 134, 0.24);
    background:
        rgba(72, 223, 134, 0.07);
}

.gold-badge {
    color: var(--gold-bright);
    border: 1px solid var(--line);
    background: var(--gold-soft);
}

.commercial-action-card h2 {
    margin: 8px 0 8px;
    font-family: "Manrope", sans-serif;
    font-size: 1.65rem;
}

.commercial-action-card p {
    color: var(--muted);
    font-size: 0.80rem;
    line-height: 1.65;
}

.action-value {
    margin: 14px 0;
    color: var(--gold-bright);
    font-family: "Manrope", sans-serif;
    font-size: 3.1rem;
    font-weight: 800;
}

.open-action {
    position: absolute;
    bottom: 27px;
    left: 28px;
    color: var(--gold-bright);
    font-size: 0.76rem;
    font-weight: 900;
}

.mini-metric-grid {
    margin: 17px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.mini-metric-grid > div {
    padding: 12px;
    border: 1px solid
        rgba(67, 166, 223, 0.15);
    border-radius: 11px;
    background:
        rgba(3, 17, 31, 0.65);
}

.mini-metric-grid small,
.mini-metric-grid strong {
    display: block;
}

.mini-metric-grid small {
    color: var(--muted);
    font-size: 0.58rem;
}

.mini-metric-grid strong {
    margin-top: 5px;
    color: var(--gold-bright);
    font-size: 0.86rem;
}

/* PANELS */

.admin-panel {
    position: relative;
    margin-top: 22px;
    padding: 28px;
    overflow: hidden;
    border: 1px solid
        rgba(148, 162, 181, 0.14);
    border-radius: 21px;
    background: var(--panel);
    box-shadow:
        0 24px 70px
        rgba(0, 0, 0, 0.20);
}

.manual-license-panel {
    border-color:
        rgba(220, 174, 78, 0.28);
}

.panel-shine {
    position: absolute;
    top: 0;
    right: 10%;
    left: 10%;
    height: 1px;
    background:
        linear-gradient(
            90deg,
            transparent,
            var(--gold-bright),
            transparent
        );
    box-shadow:
        0 0 18px
        rgba(245, 219, 135, 0.55);
}

.panel-heading {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 25px;
}

.panel-heading h2 {
    margin: 7px 0 5px;
    font-family: "Manrope", sans-serif;
    font-size: 1.55rem;
}

.panel-heading p {
    max-width: 690px;
    font-size: 0.80rem;
}

.secure-badge,
.record-count-badge {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 900;
}

.secure-badge {
    color: #9cf0c3;
    border: 1px solid
        rgba(72, 223, 134, 0.24);
    background:
        rgba(72, 223, 134, 0.08);
}

.record-count-badge {
    color: var(--gold-bright);
    border: 1px solid var(--line);
    background: var(--gold-soft);
}

/* FORMS */

label {
    display: grid;
    gap: 8px;
    color: #dbe4ed;
    font-size: 0.76rem;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    color: var(--text);
    border: 1px solid
        rgba(148, 162, 181, 0.20);
    border-radius: 11px;
    outline: none;
    background:
        rgba(2, 10, 20, 0.78);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input:focus,
select:focus {
    border-color: var(--gold);
    box-shadow:
        0 0 0 3px
        rgba(220, 174, 78, 0.09);
}

input::placeholder {
    color: #667b90;
}

.license-form {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 17px;
}

.form-note {
    grid-column: 1 / -1;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: var(--muted);
    border: 1px solid
        rgba(245, 189, 77, 0.18);
    border-radius: 11px;
    background:
        rgba(245, 189, 77, 0.05);
    font-size: 0.78rem;
    line-height: 1.55;
}

.form-note span {
    color: var(--warning);
    font-size: 1.1rem;
}

.form-note p {
    margin: 0;
}

.generate-button,
.login-card button {
    position: relative;
    min-height: 51px;
    padding: 0 21px;
    overflow: hidden;
    border: 1px solid #f1cf70;
    border-radius: 11px;
    color: #100b03;
    font-weight: 900;
    background:
        linear-gradient(
            135deg,
            #a66e20,
            #f1cf70,
            #9b651a
        );
    box-shadow:
        0 14px 35px
        rgba(220, 174, 78, 0.20);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.generate-button {
    grid-column: 1 / -1;
    justify-self: start;
}

.generate-button::after,
.login-card button::after {
    content: "";
    position: absolute;
    top: -40%;
    left: -70%;
    width: 35%;
    height: 180%;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.70),
            transparent
        );
    transform: rotate(18deg);
    animation:
        buttonShine 4s ease-in-out infinite;
}

.generate-button:hover,
.login-card button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 18px 44px
        rgba(220, 174, 78, 0.28);
}

/* TABLES */

.table-wrap {
    overflow-x: auto;
    border: 1px solid
        rgba(148, 162, 181, 0.10);
    border-radius: 14px;
}

table {
    width: 100%;
    min-width: 1160px;
    border-collapse: collapse;
}

th,
td {
    padding: 15px 13px;
    text-align: left;
    border-bottom: 1px solid
        rgba(148, 162, 181, 0.10);
    vertical-align: top;
}

thead {
    background:
        rgba(220, 174, 78, 0.04);
}

th {
    color: var(--gold);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

td {
    font-size: 0.79rem;
}

tbody tr {
    transition:
        background 0.18s ease;
}

tbody tr:hover {
    background:
        rgba(67, 166, 223, 0.035);
}

td strong,
td small {
    display: block;
}

td small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.68rem;
}

code {
    color: #c8dcf1;
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
    font-size: 0.70rem;
    overflow-wrap: anywhere;
}

.status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 0.61rem;
    font-weight: 900;
}

.status.active,
.status.confirmed {
    color: #9df0c3;
    background:
        rgba(72, 223, 134, 0.10);
}

.status.expired,
.status.revoked {
    color: #ffc0c7;
    background:
        rgba(255, 113, 129, 0.10);
}

.license-actions {
    min-width: 195px;
    display: grid;
    gap: 8px;
}

.license-actions form {
    display: flex;
    align-items: center;
    gap: 7px;
}

.license-actions select {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.67rem;
}

.download-button,
.renew-button,
.revoke-button {
    min-height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.67rem;
    font-weight: 900;
}

.download-button {
    color: var(--gold-bright);
    border: 1px solid var(--line);
    background: var(--gold-soft);
}

.renew-button {
    color: #a9f2ca;
    border: 1px solid
        rgba(72, 223, 134, 0.25);
    background:
        rgba(72, 223, 134, 0.08);
}

.revoke-button {
    color: #ffc2c9;
    border: 1px solid
        rgba(255, 113, 129, 0.26);
    background:
        rgba(255, 113, 129, 0.08);
}

.revoked-note {
    color: #ff9ca7;
    font-size: 0.70rem;
}

.empty-state {
    padding: 42px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed
        rgba(148, 162, 181, 0.20);
    border-radius: 13px;
}

.empty-state > span {
    display: block;
    font-size: 2.1rem;
}

.empty-state h3 {
    margin: 10px 0 6px;
    color: var(--gold-bright);
}

.empty-state p {
    margin: 0;
}

/* FOOTER */

.admin-footer {
    padding: 26px 20px 34px;
    display: grid;
    gap: 5px;
    color: #677c91;
    text-align: center;
    font-size: 0.66rem;
}

.admin-footer strong {
    color: var(--gold);
    letter-spacing: 0.12em;
}

/* ANIMATIONS */

@keyframes goldTextFlow {
    from {
        background-position: 0% center;
    }

    to {
        background-position: 200% center;
    }
}

@keyframes livePulse {
    0%,
    100% {
        transform: scale(0.92);
        opacity: 0.75;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes cardShine {
    0%,
    70% {
        left: -60%;
    }

    100% {
        left: 145%;
    }
}

@keyframes buttonShine {
    0%,
    58% {
        left: -70%;
    }

    100% {
        left: 145%;
    }
}

/* RESPONSIVE */

@media (max-width: 1120px) {
    .admin-header {
        grid-template-columns: 1fr auto;
    }

    .admin-navigation {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .stat-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .admin-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .system-live-card {
        min-width: 0;
        width: 100%;
    }

    .commercial-actions-grid {
        grid-template-columns: 1fr;
    }

    .license-form {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .admin-header {
        padding: 10px 13px;
        gap: 12px;
    }

    .admin-brand img {
        width: 43px;
        height: 43px;
    }

    .admin-brand strong {
        font-size: 1.15rem;
    }

    .admin-brand span {
        font-size: 0.54rem;
    }

    .website-link {
        display: none;
    }

    .admin-main {
        width: min(100% - 22px, 1460px);
        padding-top: 30px;
    }

    .admin-heading h1 {
        font-size: 2.05rem;
    }

    .stat-grid,
    .license-form {
        grid-template-columns: 1fr;
    }

    .commercial-action-card {
        min-height: 350px;
        padding: 22px;
    }

    .mini-metric-grid {
        grid-template-columns: 1fr;
    }

    .admin-panel {
        padding: 20px 15px;
    }

    .panel-heading {
        flex-direction: column;
    }

    .generate-button {
        width: 100%;
    }

    .login-card {
        padding: 28px 21px;
    }
}
