:root {
    --omega-red: #e30613;
    --omega-red-dark: #b8040f;
    --omega-navy: #0d1424;
    --omega-navy-2: #111827;
    --omega-bg: #f4f6f8;
    --omega-border: #dfe5ec;
    --omega-text: #111827;
    --omega-muted: #667085;
    --omega-card: #ffffff;
    --shadow: 0 12px 32px rgba(15, 23, 42, .08);
    --radius: 16px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--omega-bg);
    color: var(--omega-text);
}
a { color: inherit; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 250px;
    background: var(--omega-navy);
    color: #fff;
    padding: 20px 16px;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    overflow-y: auto;
}
.brand-box { display: flex; align-items: center; gap: 12px; padding: 4px 6px 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--omega-red), #7a0610);
    font-size: 25px; font-weight: 900;
}
.brand-name { font-size: 20px; font-weight: 900; line-height: 1; }
.brand-sub { margin-top: 4px; font-size: 12px; color: rgba(255,255,255,.62); }
.side-nav { display: grid; gap: 6px; margin-top: 18px; }
.side-nav a {
    display: block; text-decoration: none; padding: 12px 13px; border-radius: 12px;
    color: rgba(255,255,255,.78); font-weight: 700; font-size: 14px;
}
.side-nav a:hover, .side-nav a.is-active { background: rgba(227, 6, 19, .95); color: #fff; }
.side-nav a.is-disabled { opacity: .45; cursor: not-allowed; }
.main-area { margin-left: 250px; width: calc(100% - 250px); }
.topbar {
    height: 78px; background: #fff; border-bottom: 1px solid var(--omega-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 22px; font-weight: 900; }
.topbar-subtitle { font-size: 13px; color: var(--omega-muted); margin-top: 4px; }
.user-box { display: flex; align-items: center; gap: 11px; }
.user-avatar { width: 38px; height: 38px; border-radius: 999px; background: var(--omega-navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; }
.user-meta { display: grid; line-height: 1.15; }
.user-meta strong { font-size: 13px; }
.user-meta span { font-size: 12px; color: var(--omega-muted); margin-top: 3px; }
.content { padding: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card {
    position: relative; overflow: hidden;
    background: var(--omega-navy); color: #fff;
    border-radius: var(--radius); padding: 20px 18px;
    box-shadow: var(--shadow); min-height: 118px;
}
.stat-card:after {
    content: ""; position: absolute; right: -28px; bottom: -32px; width: 118px; height: 118px;
    border-radius: 999px; background: rgba(227,6,19,.45);
}
.stat-value { font-size: 31px; font-weight: 900; letter-spacing: -.03em; position: relative; z-index: 1; }
.stat-title { margin-top: 6px; font-size: 13px; font-weight: 900; text-transform: uppercase; position: relative; z-index: 1; }
.stat-sub { margin-top: 8px; font-size: 12px; color: rgba(255,255,255,.68); position: relative; z-index: 1; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--omega-border); margin-bottom: 18px; }
.tabs a { text-decoration: none; padding: 12px 18px; border: 1px solid var(--omega-border); border-bottom: 0; background: #fff; border-radius: 12px 12px 0 0; font-size: 13px; font-weight: 900; color: var(--omega-navy); }
.tabs a.is-active { background: var(--omega-red); color: #fff; border-color: var(--omega-red); }
.panel-card { background: #fff; border: 1px solid var(--omega-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card-title { margin: 0 0 14px; font-size: 18px; font-weight: 900; }
.notice { border: 1px solid #ffd2d6; background: #fff8f8; border-left: 5px solid var(--omega-red); padding: 13px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1; }
input, select, textarea {
    width: 100%; border: 1px solid #cfd7e2; border-radius: 10px;
    padding: 11px 12px; font-size: 14px; background: #fff; color: var(--omega-text);
}
textarea { min-height: 112px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; text-decoration: none; border-radius: 10px; padding: 11px 15px; font-size: 13px; font-weight: 900; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--omega-red); color: #fff; }
.btn-primary:hover { background: var(--omega-red-dark); }
.btn-dark { background: var(--omega-navy); color: #fff; }
.btn-light { background: #fff; border: 1px solid var(--omega-border); color: var(--omega-navy); }
.btn-ghost { background: #f6f7f9; color: var(--omega-navy); border: 1px solid var(--omega-border); }
.btn-small { padding: 8px 10px; font-size: 12px; }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--omega-border); }
table { width: 100%; border-collapse: collapse; min-width: 980px; background: #fff; }
th { background: var(--omega-navy); color: #fff; text-align: left; padding: 13px 12px; font-size: 12px; text-transform: uppercase; }
td { padding: 13px 12px; border-top: 1px solid #eef1f5; font-size: 14px; vertical-align: middle; }
tr:hover td { background: #fbfcfd; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
.badge-status-nowe { background: #e9f2ff; color: #175cd3; }
.badge-status-w_diagnozie { background: #dbeafe; color: #1d4ed8; }
.badge-status-do_wyceny { background: #efe4ff; color: #6d28d9; }
.badge-status-czeka_na_akceptacje { background: #fef3c7; color: #92400e; }
.badge-status-w_naprawie { background: #dcfce7; color: #166534; }
.badge-status-czeka_na_czesci { background: #ffedd5; color: #9a3412; }
.badge-status-do_konsultacji { background: #fee2e2; color: #991b1b; }
.badge-status-zakonczone { background: #d1fae5; color: #065f46; }
.badge-status-do_wysylki { background: #e0e7ff; color: #3730a3; }
.badge-status-reklamacja { background: #fecaca; color: #7f1d1d; }
.badge-priority-niski { background: #e5e7eb; color: #374151; }
.badge-priority-sredni { background: #fef3c7; color: #92400e; }
.badge-priority-wysoki { background: #fed7aa; color: #9a3412; }
.badge-priority-ekspres { background: #fee2e2; color: #991b1b; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-row-full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 900; color: #344054; margin-bottom: 7px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-box { background: #fbfcfd; border: 1px solid var(--omega-border); border-radius: 13px; padding: 14px; }
.detail-label { font-size: 12px; text-transform: uppercase; font-weight: 900; color: var(--omega-muted); margin-bottom: 6px; }
.detail-value { font-size: 15px; font-weight: 700; white-space: pre-wrap; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #f4f6f8, #e9edf3); }
.login-box { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--omega-border); border-radius: 18px; box-shadow: var(--shadow); padding: 30px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .brand-mark { flex: 0 0 auto; }
.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; padding: 11px 12px; border-radius: 10px; margin-top: 14px; font-size: 14px; }
.empty { padding: 30px; text-align: center; color: var(--omega-muted); }
@media (max-width: 980px) {
    .sidebar { position: static; width: 100%; }
    .app-shell { display: block; }
    .main-area { margin-left: 0; width: 100%; }
    .topbar { height: auto; gap: 16px; align-items: flex-start; flex-direction: column; padding: 18px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid, .detail-grid { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
}
@media (max-width: 560px) {
    .stats-grid { grid-template-columns: 1fr; }
    .content { padding: 16px; }
    .tabs { overflow-x: auto; }
    .user-box { width: 100%; flex-wrap: wrap; }
}
