:root {
    --bg: #eef3fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #667085;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --border: #e5e7eb;
    --green: #16a34a;
    --orange: #ea580c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--primary);
}

h1, h2, h3 {
    margin-top: 0;
}

p {
    color: var(--muted);
}

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 16px;
}

.brand {
    text-decoration: none;
    color: var(--text);
    font-size: 22px;
    font-weight: 800;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #334155;
    font-weight: 600;
}

.pill {
    background: var(--primary);
    color: white !important;
    padding: 9px 13px;
    border-radius: 999px;
}

.inline-form {
    margin: 0;
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--danger);
    font-weight: 700;
    cursor: pointer;
    font-size: 15px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.page-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 26px 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.button.primary:hover {
    background: var(--primary-dark);
}

.button.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.button.small {
    padding: 7px 10px;
    font-size: 13px;
}

.button.full {
    width: 100%;
    margin-top: 18px;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr;
    gap: 24px;
    align-items: stretch;
    margin-top: 42px;
}

.auth-layout.single {
    grid-template-columns: minmax(300px, 520px);
    justify-content: center;
}

.hero {
    background: linear-gradient(135deg, #000000, #1a1a1a) !important;
    color: white;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
}

.hero h1 {
    font-size: 44px;
}

.badge {
    display: inline-flex;
    width: fit-content;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.auth-card label,
.form-card label {
    display: block;
    margin-top: 15px;
    margin-bottom: 7px;
    font-weight: 700;
}

input, textarea, select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    font: inherit;
    background: white;
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
}

.notice {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    padding: 12px;
    border-radius: 12px;
}

.error-text {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.muted {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.stat-card span {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    font-size: 34px;
    margin-top: 8px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.cards-list {
    display: grid;
    gap: 12px;
}

.item-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.item-card h3 {
    margin-bottom: 4px;
}

.qty {
    background: #ecfdf5;
    color: #166534;
    padding: 8px 12px;
    border-radius: 999px;
    height: fit-content;
    font-weight: 800;
}

.filters {
    margin-bottom: 18px;
}

.filter-form {
    display: grid;
    grid-template-columns: 2fr 1fr auto auto auto;
    gap: 10px;
    align-items: center;
}

.checkbox {
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
    font-weight: 700;
}

.checkbox input {
    width: auto;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1050px;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.actions form {
    margin: 0;
}

.low {
    color: var(--danger);
    font-weight: 900;
}

.status {
    background: #f1f5f9;
    border-radius: 999px;
    padding: 5px 9px;
    font-weight: 700;
}

.empty {
    padding: 28px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    text-align: center;
    color: var(--muted);
}

.form-card {
    margin-top: 26px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.profile-card {
    margin-top: 26px;
    max-width: 760px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.profile-row span {
    color: var(--muted);
}

.error-card code {
    background: #f1f5f9;
    padding: 2px 5px;
    border-radius: 5px;
}

@media (max-width: 900px) {
    .auth-layout,
    .stats-grid,
    .filter-form,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-title,
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .hero h1 {
        font-size: 34px;
    }
}