@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg-1: #0f172a;
    --bg-2: #111827;
    --panel: rgba(10, 20, 40, 0.66);
    --panel-strong: rgba(8, 18, 36, 0.84);
    --line: rgba(148, 163, 184, 0.25);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --brand: #22d3ee;
    --brand-2: #06b6d4;
    --success-bg: rgba(16, 185, 129, 0.15);
    --success-border: rgba(16, 185, 129, 0.5);
    --error-bg: rgba(244, 63, 94, 0.16);
    --error-border: rgba(244, 63, 94, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 700px at 100% -10%, rgba(6, 182, 212, 0.25), transparent 40%),
        radial-gradient(900px 500px at -10% 110%, rgba(34, 211, 238, 0.2), transparent 50%),
        linear-gradient(125deg, var(--bg-1), var(--bg-2));
}

.bg-particles {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.bg-particles span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.5);
    filter: blur(0.3px);
    animation: drift 18s linear infinite;
}

.bg-particles span:nth-child(1) { left: 8%; top: 85%; animation-duration: 24s; }
.bg-particles span:nth-child(2) { left: 22%; top: 95%; animation-duration: 19s; width: 10px; height: 10px; }
.bg-particles span:nth-child(3) { left: 40%; top: 88%; animation-duration: 22s; }
.bg-particles span:nth-child(4) { left: 63%; top: 93%; animation-duration: 20s; width: 9px; height: 9px; }
.bg-particles span:nth-child(5) { left: 78%; top: 90%; animation-duration: 25s; }
.bg-particles span:nth-child(6) { left: 92%; top: 92%; animation-duration: 17s; width: 11px; height: 11px; }

@keyframes drift {
    0% { transform: translateY(0) scale(1); opacity: 0.15; }
    25% { opacity: 0.45; }
    100% { transform: translateY(-110vh) scale(1.35); opacity: 0; }
}

.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    border-right: 1px solid var(--line);
    background: var(--panel-strong);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 22px 14px;
}

.brand {
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(8, 18, 36, 0.2));
}

.brand strong {
    display: block;
    font-size: 17px;
}

.brand small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.side-nav a {
    color: var(--text);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.22s ease;
}

.side-nav a i {
    width: 18px;
    margin-right: 6px;
}

.side-nav a:hover {
    border-color: var(--line);
    background: rgba(34, 211, 238, 0.12);
    transform: translateX(2px);
}

.main {
    padding: 22px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.topbar h1 {
    margin: 0;
    font-size: 26px;
    letter-spacing: 0.2px;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.user-chip {
    text-align: right;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.5);
}

.user-chip span {
    display: block;
    font-weight: 700;
}

.user-chip small {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 11px;
}

.content-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 48px rgba(2, 6, 23, 0.35);
    animation: riseIn 0.45s ease;
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    margin-top: 22px;
}

a {
    color: var(--brand);
}

label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.6);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.85);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

button {
    margin-top: 16px;
    background: linear-gradient(140deg, var(--brand), var(--brand-2));
    color: #082f49;
    border: 0;
    padding: 11px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0.2px;
}

button:hover {
    filter: brightness(1.05);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-sm {
    margin-top: 0;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.btn-danger {
    background: linear-gradient(140deg, #fb7185, #e11d48);
    color: #fff1f2;
}

.btn-secondary {
    background: linear-gradient(140deg, #60a5fa, #2563eb);
    color: #dbeafe;
}

.btn-warning {
    background: linear-gradient(140deg, #fbbf24, #f59e0b);
    color: #422006;
}

.btn-sm i {
    margin-right: 5px;
}

.hero-block h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-compact td {
    padding: 8px;
}

.alert {
    border-radius: 10px;
    padding: 11px 12px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: #6ee7b7;
}

.alert-error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: #fda4af;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(2, 6, 23, 0.25);
    border-radius: 10px;
    overflow: hidden;
}

.hero-block {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(15, 23, 42, 0.55));
    margin-bottom: 16px;
}

.hero-block h2 {
    margin-top: 0;
}

.cards-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.marketing-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: rgba(2, 6, 23, 0.3);
}

.marketing-card h3 {
    margin-top: 0;
}

.price-pill {
    display: inline-block;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.18);
    color: #a5f3fc;
}

.kpi-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 16px;
}

.kpi-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.28);
    padding: 12px;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(103, 232, 249, 0.55);
}

.kpi-card h3 {
    margin: 0;
    font-size: 22px;
    color: #67e8f9;
}

.kpi-card p {
    margin: 4px 0 0;
    color: var(--muted);
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.table th {
    color: #bae6fd;
}

.badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-ok {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.badge-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fcd34d;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-danger {
    background: rgba(244, 63, 94, 0.2);
    color: #fda4af;
}

.contract-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.45);
    padding: 16px;
}

.contract-meta {
    color: var(--muted);
    margin-bottom: 16px;
}

.contract-section {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 12px;
}

.contract-actions {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: rgba(2, 6, 23, 0.2);
}

.content-card form {
    margin-bottom: 10px;
}

.product-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.form-panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.56), rgba(8, 18, 36, 0.72));
}

.form-panel h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #a5f3fc;
    display: flex;
    align-items: center;
    gap: 7px;
}

.form-panel label {
    margin: 8px 0 4px;
    font-size: 13px;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
    padding: 9px 10px;
    font-size: 13px;
}

@media (max-width: 940px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .main {
        padding: 16px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-chip {
        width: 100%;
        text-align: left;
    }

    .content-card {
        padding: 16px;
        overflow-x: auto;
    }
}
