* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
}

.auth-body {
    display: flex;
    justify-content: center;
    padding: 40px 16px;
}

.card {
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 32px;
    width: 100%;
    max-width: 480px;
}

h1 { font-size: 20px; font-weight: 600; margin-bottom: 24px; }

.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }

label { font-size: 13px; color: #555; }

input {
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

input:focus { outline: none; border-color: #c8102e; }

.btn {
    width: 100%;
    padding: 11px;
    background: #c8102e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
}

.btn:hover { opacity: 0.9; }

.error, .errors {
    background: #fce8eb;
    border: 1px solid #f5c0c8;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #c8102e;
}

.errors p { margin-bottom: 4px; }
.errors p:last-child { margin-bottom: 0; }

.success {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #2e7d32;
}

.divider {
    font-size: 12px;
    color: #aaa;
    margin: 16px 0 8px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.bottom-link {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #555;
}

.bottom-link a { color: #c8102e; text-decoration: none; }

/* RTL support */
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .form-row { direction: rtl; }

/* App header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid #ddd;
    margin-bottom: 24px;
}

.app-company {
    font-size: 15px;
    font-weight: 600;
    display: block;
}

.app-kassen-id {
    font-size: 11px;
    color: #888;
    display: block;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-switcher {
    display: flex;
    gap: 4px;
}

.lang-btn {
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    color: #555;
    transition: all .15s;
}

.lang-btn.active {
    background: #c8102e;
    color: white;
    border-color: #c8102e;
}

.header-logout {
    font-size: 13px;
    color: #c8102e;
    text-decoration: none;
}

select {
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #c8102e;
}

/* === Dashboard Shell === */
:root {
    --accent: #0F6E56;
    --accent-bg: #E1F5EE;
    --bg-page: #f7f7f5;
    --bg-surface: #ffffff;
    --border: rgba(0,0,0,0.08);
    --text-primary: #1c1c1a;
    --text-secondary: #5f5e5a;
    --text-tertiary: #888780;
    --sidebar-w: 220px;
    --topbar-h: 56px;
}

body {
    background: var(--bg-page);
    color: var(--text-primary);
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    flex-shrink: 0;
}
[dir="rtl"] .app-sidebar {
    border-right: none;
    border-left: 1px solid var(--border);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}
.app-brand-mark {
    width: 32px; height: 32px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.app-brand-name { font-weight: 500; font-size: 15px; }

.app-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 0.5rem; flex: 1; }

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s;
}
.nav-link:hover { background: var(--bg-page); color: var(--text-primary); }
.nav-link.active { background: var(--accent-bg); color: var(--accent); }
.nav-link i { font-size: 16px; }

.app-sidebar-footer {
    padding: 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.app-version { font-size: 11px; color: var(--text-tertiary); padding: 8px 12px; }

/* Main area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    height: var(--topbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 12px;
}
.app-page-title { font-size: 16px; font-weight: 500; margin: 0; flex: 1; }
.app-topbar-actions { display: flex; align-items: center; gap: 12px; }

.lang-switch {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.lang-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    background: transparent;
}
.lang-btn.active { background: var(--accent); color: white; }

.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding-inline-start: 12px;
    border-inline-start: 1px solid var(--border);
}
.user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 500;
}
.user-name { font-size: 13px; color: var(--text-secondary); }

.app-content { flex: 1; padding: 1.25rem; overflow-y: auto; }

.sidebar-toggle { background: transparent; border: none; font-size: 20px; padding: 0; }

/* Mobile */
@media (max-width: 767.98px) {
    .app-sidebar {
        position: fixed; top: 0; bottom: 0;
        inset-inline-start: 0;
        transform: translateX(-100%);
        transition: transform 0.2s;
        z-index: 1000;
    }
    [dir="rtl"] .app-sidebar { transform: translateX(100%); }
    .app-sidebar.open { transform: translateX(0); }
}