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

:root {
    --bg-main: #050816;
    --bg-card: rgba(10, 16, 35, 0.88);
    --bg-card-strong: rgba(15, 23, 42, 0.96);
    --border: rgba(80, 120, 255, 0.28);
    --border-pink: rgba(236, 72, 153, 0.35);
    --text-main: #f8fafc;
    --text-soft: #cbd5e1;
    --text-dim: #94a3b8;
    --blue: #38bdf8;
    --pink: #ec4899;
    --purple: #8b5cf6;
    --red: #ef4444;
    --green: #22c55e;
    --orange: #f59e0b;
    --shadow-blue: 0 0 20px rgba(56, 189, 248, 0.22);
    --shadow-pink: 0 0 20px rgba(236, 72, 153, 0.22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(139, 92, 246, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(236, 72, 153, 0.16), transparent 24%),
        radial-gradient(circle at bottom center, rgba(56, 189, 248, 0.12), transparent 32%),
        linear-gradient(180deg, #030712 0%, #050816 45%, #02040d 100%);
    min-height: 100vh;
}

.container {
    max-width: 1180px;
    margin: 40px auto;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

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

.brand-logo-frame {
    width: 78px;
    height: 78px;
    border-radius: 20px;
    padding: 4px;
    background: linear-gradient(135deg, var(--pink), var(--purple), var(--blue));
    box-shadow:
        0 0 18px rgba(236, 72, 153, 0.28),
        0 0 22px rgba(56, 189, 248, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-logo-frame.big {
    width: 110px;
    height: 110px;
    border-radius: 28px;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

h1, h2 {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    margin-top: 0;
}

.main-title {
    font-size: 2.2rem;
    margin-bottom: 6px;
    color: #ffffff;
    text-shadow:
        0 0 10px rgba(56, 189, 248, 0.35),
        0 0 18px rgba(236, 72, 153, 0.18);
}

.sub-title {
    margin: 0;
    color: var(--text-soft);
}

.eyebrow {
    display: inline-block;
    margin: 0 0 12px 0;
    font-size: 0.78rem;
    letter-spacing: 2px;
    color: var(--blue);
    font-weight: 700;
    text-transform: uppercase;
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(7, 12, 27, 0.92));
    border: 1px solid var(--border-pink);
    border-radius: 24px;
    padding: 26px;
    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.42),
        var(--shadow-blue),
        var(--shadow-pink);
}

.hero-title {
    font-size: 1.7rem;
    margin-bottom: 12px;
}

.hero-text {
    color: var(--text-soft);
    line-height: 1.7;
    max-width: 760px;
}

.hero-right {
    display: grid;
    gap: 14px;
}

.mini-stat {
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 18px;
    padding: 16px;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.02);
}

.mini-stat-label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mini-stat-value {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.05rem;
    color: white;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(7, 12, 27, 0.92));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset,
        var(--shadow-blue);
    backdrop-filter: blur(10px);
}

.card:hover {
    border-color: var(--border-pink);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.45),
        var(--shadow-blue),
        var(--shadow-pink);
}

h2 {
    font-size: 1.12rem;
    color: #ffffff;
    margin-bottom: 14px;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.18);
}

p {
    color: var(--text-soft);
    line-height: 1.6;
}

form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.button-stack form {
    width: 100%;
}

.button-stack button,
.card form button {
    min-width: 180px;
}

input[type="text"],
input[type="password"],
textarea {
    flex: 1;
    min-width: 240px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    background: rgba(2, 6, 23, 0.92);
    color: #ffffff;
    outline: none;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.25);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: #7c8aa5;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--pink);
    box-shadow:
        0 0 0 1px rgba(236, 72, 153, 0.35),
        0 0 16px rgba(236, 72, 153, 0.18);
}

textarea {
    min-height: 130px;
    resize: vertical;
}

button,
.logout-btn {
    border: none;
    border-radius: 14px;
    padding: 13px 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

button {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
    box-shadow:
        0 0 12px rgba(236, 72, 153, 0.25),
        0 8px 20px rgba(0, 0, 0, 0.28);
}

button:hover,
.logout-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.delete-btn,
.logout-btn {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.22);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: rgba(2, 6, 23, 0.45);
    border-radius: 14px;
    overflow: hidden;
}

th {
    background: rgba(15, 23, 42, 0.98);
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.32);
    text-align: left;
    vertical-align: middle;
}

td {
    color: var(--text-soft);
}

tr:hover td {
    background: rgba(30, 41, 59, 0.45);
}

.username-cell {
    font-weight: 700;
    color: #ffffff;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.status-badge.live {
    color: #dcfce7;
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.35);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.18);
}

.status-badge.offline {
    color: #e2e8f0;
    background: rgba(100, 116, 139, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.28);
}

.status-badge.sent {
    color: #dbeafe;
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.34);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.14);
}

.status-badge.waiting {
    color: #fef3c7;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.34);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.12);
}

.flash {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-weight: 600;
}

.flash.success {
    background: rgba(20, 83, 45, 0.28);
    border-color: rgba(34, 197, 94, 0.32);
    color: #dcfce7;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.12);
}

.flash.error {
    background: rgba(127, 29, 29, 0.28);
    border-color: rgba(239, 68, 68, 0.32);
    color: #fee2e2;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.12);
}

.empty-box {
    border: 1px dashed rgba(56, 189, 248, 0.28);
    border-radius: 16px;
    padding: 20px;
    background: rgba(2, 6, 23, 0.38);
    text-align: center;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.section-sub {
    margin: 0;
    color: var(--text-dim);
}

.section-pill {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.24);
    color: #dbeafe;
    font-weight: 700;
    font-size: 0.85rem;
}

.footer-bar {
    margin-top: 12px;
    padding: 18px 22px;
    border-radius: 18px;
    border: 1px solid rgba(56, 189, 248, 0.16);
    background: rgba(2, 6, 23, 0.42);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.footer-text {
    color: var(--text-dim);
    margin-left: 8px;
}

.login-shell {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 560px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(7, 12, 27, 0.94));
    border: 1px solid var(--border-pink);
    border-radius: 24px;
    padding: 28px;
    box-shadow:
        0 16px 42px rgba(0, 0, 0, 0.42),
        var(--shadow-blue),
        var(--shadow-pink);
}

strong {
    color: #ffffff;
}

.card p strong {
    color: var(--blue);
}

@media (max-width: 900px) {
    .hero-panel,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
        margin: 20px auto;
    }

    .main-title {
        font-size: 1.6rem;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .card,
    .login-card,
    .hero-panel {
        padding: 18px;
        border-radius: 18px;
    }

    form {
        flex-direction: column;
    }

    button,
    .logout-btn {
        width: 100%;
        text-align: center;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .footer-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}
