* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, Arial, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

a {
    text-decoration: none;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top left, #4f46e5 0%, transparent 30%),
        radial-gradient(circle at bottom right, #7c3aed 0%, transparent 30%),
        linear-gradient(135deg, #111827, #1e293b);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.login-title {
    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
}

.login-subtitle {
    margin: 0 0 24px;
    text-align: center;
    color: #6b7280;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.25);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-success {
    background: #10b981;
    color: #fff;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #0f172a;
    color: #fff;
    padding: 24px 18px;
    flex-shrink: 0;
}

.brand {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 24px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu a {
    color: #cbd5e1;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
}

.menu a:hover,
.menu a.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}

.sidebar-bottom {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.main {
    flex: 1;
    padding: 28px;
}

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

.page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
}

.page-subtitle {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
}

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

.card {
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.card-title {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 700;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
}

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

.table th,
.table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    vertical-align: middle;
}

.table th {
    color: #6b7280;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.small {
    color: #6b7280;
    font-size: 13px;
}

.empty {
    text-align: center;
    color: #6b7280;
    padding: 30px 0;
}

.code-preview {
    font-family: monospace;
    font-size: 13px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    border-radius: 10px;
}

@media (max-width: 900px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

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

    .main {
        padding: 16px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}