* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f4f5f9;
    color: #1f2430;
}

a {
    color: inherit;
}

.topbar {
    background: #1f2430;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.topbar .brand {
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    color: #fff;
    margin-right: 20px;
}

.topbar nav {
    flex: 1;
}

.topbar nav a {
    margin-right: 16px;
    text-decoration: none;
    color: #cbd0e0;
    font-weight: 600;
    font-size: 14px;
}

.topbar nav a:hover {
    color: #fff;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #cbd0e0;
}

.nav-user a {
    text-decoration: none;
    color: #a5b4fc;
    font-weight: 600;
}

.nav-user small {
    color: #8b93a7;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 0 16px;
}

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
}

.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }

.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.card h2, .card h3 { margin-top: 0; }

.form-row { margin-bottom: 14px; }

.row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=password],
.form-row input[type=date],
.form-row input[type=number],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d7dae2;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.form-row textarea { min-height: 90px; resize: vertical; }
.form-row input[type=file] { padding: 8px 0; }

.form-actions { display: flex; gap: 10px; margin-top: 20px; }

button, .btn {
    display: inline-block;
    background: #4f46e5;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .btn:hover { background: #4338ca; }

.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-small { padding: 6px 12px; font-size: 13px; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

table.data-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 12px 14px;
    border-bottom: 2px solid #eee;
    background: #fafbfc;
}

table.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

table.data-table tr:hover td { background: #f8fafc; }

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

.status-active, .status-draft { background: #f3f4f6; color: #4b5563; }
.status-disabled, .status-rejected { background: #fee2e2; color: #991b1b; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-submitted { background: #dbeafe; color: #1e40af; }
.status-delivered { background: #d1fae5; color: #065f46; }

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: #eef2ff;
    color: #4338ca;
}

.empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 40px 0;
}

.footer {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    padding: 20px 0;
}

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

@media (max-width: 640px) {
    .row-2col { grid-template-columns: 1fr; gap: 0; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .table-scroll { overflow-x: auto; }
}
