*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #1e293b;
    background: #f1f5f9;
    height: 100%;
}

/* ===== APP LAYOUT ===== */
.app-layout {
    display: flex;
    height: 100vh;
}

/* ===== SIDEBAR ===== */
.app-sidebar {
    width: 250px;
    min-width: 250px;
    background: #1e293b;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand a {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
}

.nav-item.active {
    background: rgba(59,130,246,0.1);
    color: #60a5fa;
    border-left-color: #3b82f6;
}

.nav-item .material-icons {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-section {
    padding: 16px 24px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
}

/* ===== MAIN ===== */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== HEADER ===== */
.app-header {
    height: 56px;
    min-height: 56px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-breadcrumb {
    font-size: 0.85rem;
    color: #64748b;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-user {
    font-size: 0.85rem;
    color: #475569;
    margin-right: 8px;
}

.header-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.header-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.header-btn-primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.header-btn-primary:hover {
    background: #2563eb;
}

.header-btn-logout {
    color: #ef4444;
    border-color: #fecaca;
}

.header-btn-logout:hover {
    background: #fef2f2;
}

/* ===== CONTENT ===== */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ===== BLAZOR ERROR ===== */
.blazor-error-boundary {
    background: #dc2626;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Wystąpił błąd."
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #22c55e;
}

.invalid {
    outline: 1px solid #ef4444;
}

.validation-message {
    color: #ef4444;
    font-size: 0.85rem;
}
