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

:root {
    --bg:           #f0f1f5;
    --surface:      #ffffff;
    --border:       #e0e2e8;
    --accent:       #446084;
    --accent-hover: #3a5270;
    --text:         #212529;
    --muted:        #6b7280;
    --success:      #22c55e;
    --error:        #ef4444;
    --warning:      #f59e0b;
    --radius:       8px;
    --sidebar-w:    240px;
    --topbar-h:     56px;
    --sidebar-bg:   #1c2434;
}

html, body { height: 100%; overflow-x: hidden; }
body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

/* ── Auth pages ────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 1.5rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1.75rem;
}
.auth-brand-icon { font-size: 1.4rem; }

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: .875rem;
    color: var(--muted);
}
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* ── App layout ────────────────────────────────── */
.app-page {
    display: flex;
    min-height: 100vh;
}

.app-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform .25s;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}
.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    color: white;
}
.sidebar-brand-icon { color: #6ea8d8; font-size: 1.2rem; }
.sidebar-brand-name { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }

.sidebar-close {
    display: none;
    background: none; border: none;
    color: rgba(255,255,255,.4); font-size: 1.1rem; cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem 1.25rem;
    color: rgba(255,255,255,.55);
    text-decoration: none;
    font-size: .85rem;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
}
.sidebar-nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.sidebar-nav-item.active { background: rgba(68,96,132,.3); color: white; border-left-color: #6ea8d8; }
.sidebar-nav-item svg { flex-shrink: 0; opacity: .7; }

.sidebar-nav-new {
    margin-top: .5rem;
    border-top: 1px solid rgba(255,255,255,.07);
    padding-top: .75rem;
}

.sidebar-section { margin-top: .25rem; }
.sidebar-section-header { padding: .6rem 1.25rem .1rem; }
.sidebar-section-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,.35);
    text-decoration: none;
    display: block;
    transition: color .15s;
}
.sidebar-section-title:hover,
.sidebar-section-title.active { color: rgba(255,255,255,.7); }

.sidebar-board-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem 1.25rem;
    color: rgba(255,255,255,.5);
    text-decoration: none;
    font-size: .82rem;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-board-link:hover { background: rgba(255,255,255,.05); color: white; }
.sidebar-board-link.active { background: rgba(68,96,132,.25); color: white; border-left-color: #6ea8d8; }

.board-dot {
    width: 10px; height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .875rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}
.sidebar-footer-info { flex: 1; min-width: 0; }
.sidebar-footer-info strong {
    display: block;
    color: rgba(255,255,255,.8);
    font-size: .82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-footer-info small { color: rgba(255,255,255,.35); font-size: .72rem; }
.sidebar-logout {
    color: rgba(255,255,255,.3);
    text-decoration: none;
    transition: color .15s;
    display: flex;
    align-items: center;
}
.sidebar-logout:hover { color: rgba(255,255,255,.7); }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 190;
}

/* ── Topbar ────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}
.topbar-hamburger {
    display: none;
    background: none; border: none;
    font-size: 1.2rem; cursor: pointer; color: var(--muted); padding: .25rem;
}
.topbar-title { font-weight: 600; font-size: .95rem; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    flex: 1;
}
.topbar-breadcrumb a { color: var(--muted); text-decoration: none; }
.topbar-breadcrumb a:hover { color: var(--text); }
.topbar-breadcrumb span:last-child { color: var(--text); font-weight: 600; }

/* ── App content ───────────────────────────────── */
.app-content { flex: 1; padding: 2rem 1.75rem; }

.container { max-width: 1200px; margin: 0 auto; }
.container-sm { max-width: 560px; }
.container h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-header h1 { margin-bottom: 0; }

/* ── Forms ─────────────────────────────────────── */
label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-size: .875rem;
    color: var(--muted);
    font-weight: 500;
}
label small { font-weight: 400; color: var(--muted); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea,
select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .65rem .875rem;
    color: var(--text);
    font-size: .9rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(68,96,132,.12);
}

.form-stack { display: flex; flex-direction: column; gap: 1rem; }
.form-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.form-inline { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.form-inline input { flex: 1; min-width: 200px; }

/* ── Buttons ───────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.25rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-ghost.active { background: var(--bg); border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--error); color: white; border-color: var(--error); }
.btn-danger:hover { background: #dc2626; }
.btn-full { width: 100%; }
.btn-sm { padding: .4rem .875rem; font-size: .8rem; }

/* ── Alerts ────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .875rem;
    margin-bottom: 1rem;
    border: 1px solid;
}
.alert-error   { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
.alert-success { background: #f0fdf4; color: #16a34a; border-color: #86efac; }

/* ── Cards / surfaces ──────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }

/* ── Avatar ────────────────────────────────────── */
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: .875rem;
    flex-shrink: 0;
    text-transform: uppercase;
}
.avatar-sm { width: 22px; height: 22px; font-size: .7rem; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

/* ── Profile page ───────────────────────────────── */
.profile-pic-section { display: flex; flex-direction: column; gap: .75rem; }
.profile-pic-fallback { width: 80px; height: 80px; font-size: 2rem; }
.profile-pic-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; display: block; }
.profile-pic-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.profile-pic-hint { font-size: .75rem; color: var(--muted); margin: 0; }
.sidebar-footer-avatar { display: contents; }
.sidebar-footer-name { color: inherit; text-decoration: none; }
.sidebar-footer-name:hover { color: var(--accent); }

/* ── Role badge ────────────────────────────────── */
.role-badge {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
}
.role-owner  { background: #ede9fe; color: #5b21b6; }
.role-admin  { background: #dbeafe; color: #1d4ed8; }
.role-member { background: #f3f4f6; color: var(--muted); }

/* ── Dashboard ─────────────────────────────────── */
.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.company-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.company-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}
.company-card-header h2 { font-size: 1rem; font-weight: 700; }
.company-card-header a { color: var(--text); text-decoration: none; }
.company-card-header a:hover { color: var(--accent); }

.board-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.board-chip {
    display: inline-flex;
    align-items: center;
    padding: .3rem .75rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 500;
    background: var(--chip-color, var(--accent));
    color: white;
    text-decoration: none;
    transition: opacity .15s;
}
.board-chip:hover { opacity: .85; }
.board-chip-new {
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--muted);
}
.board-chip-new:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }

.company-card-new {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    border: 2px dashed var(--border);
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: border-color .15s, color .15s, background .15s;
    cursor: pointer;
}
.company-card-new:hover { border-color: var(--accent); color: var(--accent); background: rgba(68,96,132,.03); }

/* ── Empty state ───────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}
.empty-icon { font-size: 3rem; color: var(--border); margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.1rem; margin-bottom: .5rem; }
.empty-state p { color: var(--muted); margin-bottom: 1.5rem; }

/* ── Company boards grid ───────────────────────── */
.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.board-card {
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    transition: transform .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
}
.board-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.board-card-color {
    height: 80px;
    background: var(--board-color, #446084);
}
.board-card-body { padding: .875rem 1rem; }
.board-card-body h3 { font-size: .9rem; font-weight: 600; }
.board-card-body p { font-size: .8rem; color: var(--muted); margin-top: .25rem; }

/* ── Color picker ──────────────────────────────── */
.color-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.color-option { cursor: pointer; }
.color-option input { display: none; }
.color-swatch {
    display: block;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: border-color .15s, transform .15s;
}
.color-option input:checked + .color-swatch {
    border-color: var(--text);
    transform: scale(1.15);
}

/* ── Members ───────────────────────────────────── */
.members-list { padding: 0; }
.member-row {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .875rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-info { flex: 1; min-width: 0; }
.member-info strong { display: block; font-size: .9rem; }
.member-info small { color: var(--muted); font-size: .8rem; }

/* ── Board page ────────────────────────────────── */
.board-page { overflow: hidden; }
.board-main {
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.board-topbar {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.board-wrap {
    flex: 1;
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem;
    gap: .875rem;
}

.list {
    width: 272px;
    min-width: 272px;
    background: #ebecf0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--topbar-h) - 2rem);
    flex-shrink: 0;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem .875rem .5rem;
    gap: .5rem;
}
.list-title {
    font-weight: 700;
    font-size: .875rem;
    color: #172b4d;
    flex: 1;
    min-width: 0;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}
.list-title[contenteditable]:focus {
    outline: 2px solid var(--accent);
    background: white;
}
.list-count {
    background: rgba(0,0,0,.1);
    color: #172b4d;
    border-radius: 20px;
    padding: .1rem .5rem;
    font-size: .72rem;
    font-weight: 600;
    flex-shrink: 0;
}

.list-cards {
    flex: 1;
    overflow-y: auto;
    padding: .25rem .5rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: 16px;
    scrollbar-width: thin;
}
.list-cards.drag-over { background: rgba(68,96,132,.08); border-radius: 6px; }

.card-item {
    background: white;
    border-radius: 6px;
    padding: .625rem .75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
    cursor: pointer;
    transition: box-shadow .15s, transform .1s;
    user-select: none;
}
.card-item:hover { box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.card-item.dragging { opacity: .4; transform: rotate(2deg); }
.card-item.drag-placeholder {
    background: rgba(68,96,132,.12);
    box-shadow: none;
    border: 2px dashed rgba(68,96,132,.3);
    height: 40px;
}

.card-label {
    height: 6px;
    border-radius: 3px;
    margin-bottom: .5rem;
}
.card-title { font-size: .85rem; color: #172b4d; line-height: 1.4; }
.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .4rem;
    gap: .5rem;
}
.card-due { font-size: .72rem; color: var(--muted); }
.card-due.overdue { color: var(--error); font-weight: 600; }
.card-avatars { display: flex; gap: .2rem; }

.list-footer { padding: .25rem .5rem .625rem; }
.add-card-form { padding: .25rem; }
.add-card-input {
    width: 100%;
    resize: none;
    border: none;
    border-radius: 6px;
    padding: .5rem .625rem;
    font-size: .85rem;
    font-family: inherit;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
    outline: none;
    margin-bottom: .5rem;
}
.add-card-actions { display: flex; gap: .5rem; }

.btn-add-card {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: .45rem .625rem;
    border-radius: 6px;
    color: #5e6c84;
    font-size: .85rem;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, color .15s;
}
.btn-add-card:hover { background: rgba(0,0,0,.06); color: #172b4d; }

.list-new { background: rgba(235,236,240,.6); }
.list-new-form { padding: .75rem .875rem; display: flex; flex-direction: column; gap: .5rem; }
.list-new-input {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .5rem .75rem;
    font-size: .875rem;
    font-family: inherit;
}
.btn-add-list {
    width: 100%;
    background: none;
    border: none;
    padding: .75rem;
    color: rgba(23,43,77,.6);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border-radius: 10px;
    text-align: left;
    transition: background .15s, color .15s;
}
.btn-add-list:hover { background: rgba(255,255,255,.4); color: #172b4d; }

/* ── Modal ─────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
}
.modal {
    background: var(--bg);
    border-radius: 12px;
    width: 100%;
    max-width: 640px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    padding: 1.5rem;
}
.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none;
    color: var(--muted); font-size: 1.1rem;
    cursor: pointer; line-height: 1;
    border-radius: 4px; padding: .2rem .4rem;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-header { margin-bottom: 1.25rem; }
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }

.modal-grid { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; }
.modal-body { display: flex; flex-direction: column; gap: 1rem; }
.modal-sidebar { min-width: 160px; display: flex; flex-direction: column; gap: .75rem; }

.modal-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .35rem; }
.modal-members { display: flex; flex-wrap: wrap; gap: .35rem; }

.member-toggle {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .6rem;
    border-radius: 20px;
    font-size: .78rem;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: background .15s;
}
.member-toggle.assigned { background: var(--accent); color: white; border-color: var(--accent); }

.label-colors { display: flex; gap: .35rem; flex-wrap: wrap; }
.label-color-btn {
    width: 24px; height: 24px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .15s;
}
.label-color-btn:hover { transform: scale(1.15); }
.label-color-btn.selected { border-color: var(--text); }

/* ── Notifications ─────────────────────────────── */
.notif-container {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 10000; pointer-events: none;
    display: flex; flex-direction: column;
}
.notif-bar {
    display: flex; align-items: center; gap: .6rem;
    padding: .7rem 1.25rem; font-size: .875rem; font-weight: 500;
    color: white; pointer-events: auto;
    box-shadow: 0 3px 10px rgba(0,0,0,.2);
    transform: translateY(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.notif-bar.visible { transform: translateY(0); }
.notif-bar.hiding { transform: translateX(110%); transition: transform .35s; }
.notif-success { background: #16a34a; }
.notif-error   { background: #dc2626; }
.notif-info    { background: #2563eb; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .sidebar-overlay.open { display: block; }
    .app-main { margin-left: 0; }
    .board-main { margin-left: 0; }
    .topbar-hamburger { display: block; }
    .topbar { padding: 0 1rem; }
    .app-content { padding: 1.25rem .875rem; }
}
@media (max-width: 600px) {
    .app-content { padding: 1rem .75rem; }
    .container h1 { font-size: 1.25rem; }
    .company-grid { grid-template-columns: 1fr; }
    .board-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .modal-grid { grid-template-columns: 1fr; }
    .modal-overlay { padding: .5rem .25rem; }
    .modal { border-radius: 0 0 12px 12px; margin-top: auto; }
    .form-inline { flex-direction: column; align-items: stretch; }
}

/* ── Topbar language dropdown ──────────────────── */
.topbar-lang {
    position: relative;
    flex-shrink: 0;
}
.topbar-lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background .15s, border-color .15s;
}
.topbar-lang-btn:hover { background: var(--bg); border-color: var(--accent); }
.topbar-lang-btn img { display: block; border-radius: 2px; }
.topbar-lang-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    min-width: 130px;
    z-index: 300;
    overflow: hidden;
}
.topbar-lang-menu.open { display: block; }
.topbar-lang-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .45rem .75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: .875rem;
    color: var(--text);
    text-align: left;
}
.topbar-lang-option:hover { background: var(--bg); }
.topbar-lang-option.active { color: var(--accent); font-weight: 600; }
.topbar-lang-option img { display: block; border-radius: 2px; flex-shrink: 0; }

/* ── Language switcher (profile card) ──────────── */
.lang-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-size: .875rem;
    color: var(--text);
    transition: border-color .15s, background .15s;
}
.lang-btn:hover { border-color: var(--accent); background: var(--bg); }
.lang-btn.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.lang-btn img { border-radius: 2px; display: block; }
