:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #111827;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(245, 247, 251, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.7);
    margin: 0 -16px 16px;
    padding: 12px 16px;
}

.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.brand {
    font-size: 20px;
    font-weight: 700;
}

.nav-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.card-title {
    margin: 0 0 12px;
    font-size: 20px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
}

.btn.secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn.danger {
    background: var(--danger);
}

.btn.success {
    background: var(--success);
}

.btn.warning {
    background: var(--warning);
}

.btn.full {
    width: 100%;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
}

.row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.space-between {
    justify-content: space-between;
}

form {
    margin: 0;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.field {
    margin-bottom: 12px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 14px;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 14px;
}

th {
    background: #f9fafb;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.tag {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #eef2ff;
    color: #3730a3;
}

.tag.success {
    background: #dcfce7;
    color: #166534;
}

.tag.warning {
    background: #fef3c7;
    color: #92400e;
}

.tag.danger {
    background: #fee2e2;
    color: #991b1b;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.login-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.alert-error {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warn {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

@media (max-width: 900px) {
    .grid-4,
    .grid-3,
    .grid-2,
    .stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .page {
        padding: 12px;
    }

    .navbar {
        margin: 0 -12px 12px;
        padding: 10px 12px;
    }

    .brand {
        font-size: 18px;
    }

    .grid-4,
    .grid-3,
    .grid-2,
    .stats {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 14px;
        border-radius: 14px;
    }

    .card-title {
        font-size: 18px;
    }

    .btn {
        min-height: 44px;
    }

    table {
        min-width: 640px;
    }
}