* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f6f6f7;
    color: #202223;
}

a {
    color: #2c6ecb;
    text-decoration: none;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top, #eaf1ff, transparent 40%),
        #f6f6f7;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

.auth-logo {
    font-weight: 800;
    font-size: 22px;
    margin-bottom: 24px;
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

label {
    display: block;
    margin: 16px 0 6px;
    font-size: 14px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #c9cccf;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2c6ecb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(44,110,203,.15);
}

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

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

.btn-primary {
    background: #202223;
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: #202223;
    border: 1px solid #c9cccf;
}

.full {
    width: 100%;
    margin-top: 22px;
}

.muted {
    color: #6d7175;
}

.alert {
    border-radius: 8px;
    padding: 12px;
    margin: 18px 0;
    font-size: 14px;
}

.alert-error {
    background: #fff4f4;
    color: #8a1f11;
    border: 1px solid #ffd6d6;
}

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

.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #dfe3e8;
    padding: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: #202223;
    color: #fff;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.brand span {
    display: block;
    font-size: 12px;
    color: #6d7175;
    margin-top: 2px;
}

.nav {
    display: grid;
    gap: 4px;
}

.nav a {
    color: #202223;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.nav a:hover {
    background: #f1f2f3;
}

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #dfe3e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.content {
    padding: 32px;
}

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

.page-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card,
.card {
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

.stat-card span {
    display: block;
    color: #6d7175;
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-card strong {
    font-size: 28px;
}

.card h2 {
    margin-top: 0;
}

.alert-success {
    background: #f1f8f5;
    color: #0a5c36;
    border: 1px solid #bde5d0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #dfe3e8;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: #6d7175;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.table-actions {
    white-space: nowrap;
    text-align: right !important;
}

.btn-small {
    padding: 7px 10px;
    font-size: 13px;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #e3f1df;
    color: #108043;
}

.badge-muted {
    background: #f1f2f3;
    color: #6d7175;
}

.form-card {
    max-width: 900px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-weight: 500;
}

.checkbox-label input {
    width: auto;
}

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

.badge-warning {
    background: #fff5d6;
    color: #8a6116;
}

.badge-danger-light {
    background: #ffe9e8;
    color: #bf0711;
}

.purchase-item {
    border: 1px solid #dfe3e8;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fafbfb;
}

.purchase-item .remove-item {
    margin-top: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.card-header-row h2 {
    margin: 0;
}

.compact-table th,
.compact-table td {
    padding: 10px 8px;
}

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

@media (max-width: 1000px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.inline-create-form {
    margin-bottom: 20px;
}

.option-row-form {
    display: contents;
}

.inline-delete-form {
    display: inline;
}

.align-bottom {
    align-items: flex-end;
    margin-top: 22px;
}

.compact-checkbox {
    margin: 0;
}