/*
 * E-Iroda responsive/navigation consolidation
 * Loaded last. It intentionally overrides legacy mobile rules from app.css
 * and portal-v17.css without changing feature-specific component styling.
 */

html {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

.topbar {
    position: relative;
    z-index: 1000;
    width: 100%;
    padding: 0;
}

.topbar-inner,
.container,
.page-heading,
.dashboard-kpi-grid,
.dashboard-grid,
.dashboard-grid-wide,
.panel,
.table-wrap {
    min-width: 0;
}

.container {
    width: min(100%, 1180px);
}

/* Remove every legacy pseudo-icon. The button contains the real SVG icons. */
.mobile-nav-toggle::before,
.mobile-nav-toggle::after {
    content: none !important;
    display: none !important;
}

.mobile-nav-toggle {
    isolation: isolate;
}

.mobile-nav-svg {
    pointer-events: none;
}

.nav-backdrop {
    margin: 0;
}

@media (max-width: 1100px) {
    body.nav-open {
        overflow: hidden;
        touch-action: none;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 10020;
        min-height: 64px;
    }

    .topbar-inner {
        width: 100%;
        max-width: none;
        min-height: 64px;
        padding: 0 16px;
    }

    .mobile-nav-toggle,
    body.nav-open .mobile-nav-toggle {
        position: relative;
        top: auto;
        right: auto;
        z-index: 3 !important;
        display: inline-grid;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        place-items: center;
        pointer-events: auto !important;
        touch-action: manipulation;
    }

    /* Drawer remains inside the header stacking context, above backdrop. */
    .role-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        z-index: 2 !important;
        display: flex;
        width: min(360px, 88vw);
        max-width: 100%;
        max-height: none;
        padding: 78px 18px 24px;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 0;
        border-radius: 0;
        background: #fff;
        box-shadow: -18px 0 45px rgba(22, 48, 71, .18);
        transform: translate3d(105%, 0, 0);
        visibility: hidden;
        pointer-events: none;
        transition: transform .24s ease, visibility 0s linear .24s;
    }

    body.nav-open .role-nav {
        transform: translate3d(0, 0, 0);
        visibility: visible;
        pointer-events: auto;
        transition: transform .24s ease;
    }

    .role-nav-links,
    .role-nav .logout-form {
        width: 100%;
        min-width: 0;
    }

    .role-nav .nav-link,
    .role-nav-links .button,
    .role-nav .logout-form .nav-link {
        width: 100%;
        max-width: 100%;
        min-height: 46px;
        padding: 11px 12px;
        justify-content: flex-start;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: left;
    }

    .nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 10010 !important;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(15, 35, 50, .42);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .24s ease, visibility 0s linear .24s;
    }

    body.nav-open .nav-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity .24s ease;
    }

    body.nav-open::after {
        content: none !important;
        display: none !important;
    }
}

@media (max-width: 760px) {
    .container {
        width: 100%;
        max-width: none;
        padding: 22px 16px 40px;
    }

    .page-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .page-heading > *,
    .page-heading .actions {
        width: 100%;
        min-width: 0;
    }

    .page-heading .actions {
        display: grid;
        grid-template-columns: 1fr;
        margin-top: 0;
    }

    .dashboard-grid,
    .dashboard-grid-wide {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
    }

    .dashboard-kpi-grid {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .panel {
        width: 100%;
        max-width: 100%;
    }

    .table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
    }

    .dashboard-grid-wide table {
        min-width: 560px;
    }
}

@media (max-width: 420px) {
    .topbar-inner {
        padding: 0 12px;
    }

    .container {
        padding-right: 12px;
        padding-left: 12px;
    }

    .role-nav {
        width: min(340px, 92vw);
        padding-right: 14px;
        padding-left: 14px;
    }

    .dashboard-kpi-grid {
        gap: 9px;
    }

    .dashboard-kpi-grid .stat {
        padding: 14px 12px;
    }
}

/* Touch phones/tablets must not fall back to desktop two-column dashboard
   merely because browser scaling reports a wider CSS viewport. */
@media (hover: none) and (pointer: coarse) and (max-width: 1100px) {
    .dashboard-grid,
    .dashboard-grid-wide {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .role-nav,
    .nav-backdrop {
        transition: none !important;
    }
}

/* ========================================
   TISZTA ASZTALI NÉZET
   A fejléc szélesebb munkaterületet kap, a navigáció egy sorban marad,
   a vezérlőpult pedig kiegyensúlyozottabb térközökkel jelenik meg.
======================================== */
@media (min-width: 1101px) {
    .topbar {
        min-height: 76px;
        background: rgba(255, 255, 255, .98);
        border-top: 4px solid #c9daf0;
        border-bottom: 1px solid #d8e3eb;
        box-shadow: 0 1px 0 rgba(22, 48, 71, .03);
    }

    .topbar-inner {
        width: min(calc(100% - 48px), 1440px);
        max-width: 1440px;
        min-height: 72px;
        margin: 0 auto;
        padding: 0;
        display: grid;
        grid-template-columns: minmax(250px, auto) minmax(0, 1fr);
        align-items: center;
        column-gap: 34px;
    }

    .topbar .brand-block {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 14px;
        white-space: nowrap;
    }

    .brand {
        font-size: 1.08rem;
        letter-spacing: -.015em;
    }

    .brand-context {
        display: block;
        max-width: 210px;
        padding-left: 14px;
        overflow: hidden;
        border-left: 1px solid #d9e3ea;
        color: #60798c;
        font-size: .76rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .role-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
        min-width: 0;
        align-items: stretch;
        justify-content: stretch;
        gap: 18px;
    }

    .role-nav-links {
        display: flex;
        min-width: 0;
        align-items: stretch;
        justify-content: flex-end;
        gap: 4px;
        white-space: nowrap;
    }

    .role-nav .nav-link,
    .role-nav-links .button {
        position: relative;
        display: inline-flex;
        min-height: 72px;
        padding: 0 10px;
        align-items: center;
        border-radius: 0;
        font-size: .88rem;
        line-height: 1.2;
    }

    .role-nav .nav-link:hover {
        background: #f5f8fb;
        color: #0e4768;
    }

    .role-nav .nav-link.active {
        background: transparent;
        color: #123c59;
        font-weight: 800;
    }

    .role-nav .nav-link.active::after {
        content: "";
        position: absolute;
        right: 10px;
        bottom: 10px;
        left: 10px;
        height: 2px;
        border-radius: 999px;
        background: #173b57;
    }

    .role-nav .logout-form {
        display: flex;
        min-width: 118px;
        margin: 0;
        padding: 0 0 0 18px;
        align-items: stretch;
        border-left: 1px solid #dce6ed;
    }

    .role-nav .logout-form .nav-link {
        width: 100%;
        min-height: 72px;
        padding: 0 10px;
        justify-content: center;
    }

    .container {
        width: min(calc(100% - 48px), 1280px);
        max-width: 1280px;
        padding: 52px 0 64px;
    }

    .page-heading {
        margin-bottom: 30px;
        align-items: center;
        gap: 32px;
    }

    .page-heading > div:first-child {
        max-width: 760px;
    }

    .page-heading h1 {
        margin: 9px 0 12px;
        font-size: clamp(2rem, 2.2vw, 2.55rem);
        line-height: 1.08;
        letter-spacing: -.035em;
    }

    .page-heading .muted {
        margin: 0;
        font-size: 1rem;
        line-height: 1.55;
    }

    .page-heading .actions {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 12px;
    }

    .page-heading .actions .button {
        min-width: 118px;
        min-height: 48px;
        justify-content: center;
    }

    .message-clear-panel,
    .message-alert-panel {
        margin-bottom: 22px;
    }

    .dashboard-kpi-grid {
        gap: 18px;
        margin-bottom: 22px;
    }

    .dashboard-kpi-grid .stat {
        min-height: 126px;
        padding: 22px 20px;
    }

    .dashboard-grid-wide {
        gap: 22px;
    }

    .panel {
        border-radius: 18px;
    }
}

/* Közepes asztali / kisebb laptop: maradjon egy soros a fejléc. */
@media (min-width: 1101px) and (max-width: 1280px) {
    .topbar-inner {
        width: calc(100% - 32px);
        grid-template-columns: minmax(205px, auto) minmax(0, 1fr);
        column-gap: 18px;
    }

    .brand-context {
        display: none;
    }

    .role-nav-links {
        gap: 0;
    }

    .role-nav .nav-link,
    .role-nav-links .button {
        padding-right: 8px;
        padding-left: 8px;
        font-size: .82rem;
    }

    .role-nav .logout-form {
        min-width: 102px;
        padding-left: 10px;
    }

    .container {
        width: calc(100% - 40px);
    }
}

/* Ügyféladatlap műveleti sáv és ellenőrzőlista */
.client-action-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -14px 0 24px;
    padding: 12px;
    border: 1px solid #d7e3eb;
    border-radius: 16px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 10px 30px rgba(31,63,84,.08);
    backdrop-filter: blur(10px);
}
.client-action-bar form { margin: 0; }
.client-action {
    display: inline-flex;
    min-height: 42px;
    padding: 0 15px;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbdbe5;
    border-radius: 10px;
    background: #fff;
    color: #173b57;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.client-action:hover { background: #edf5f9; }
.client-action.warning { border-color: #ebc875; background: #fff9e9; color: #80590b; }
.client-action.success { border-color: #a9d9bf; background: #edf9f2; color: #17643b; }
.client-work-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.client-work-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid #d8e4ec;
    border-radius: 15px;
    background: #fff;
}
.client-work-card > span { display:block; margin-bottom: 9px; color:#647b8c; font-size:.9rem; }
.client-work-card strong { display:block; color:#153a55; font-size:1.35rem; }
.client-work-card small { display:block; margin-top:7px; color:#6c8190; }
.mini-progress { height:7px; margin-top:12px; overflow:hidden; border-radius:999px; background:#e8eff4; }
.mini-progress span { display:block; height:100%; border-radius:inherit; background:#1d7452; }
.checklist-panel { scroll-margin-top: 90px; }
.period-switcher { display:flex; gap:8px; align-items:center; }
.period-switcher select { min-height:42px; }
.checklist-list { display:grid; gap:10px; }
.checklist-item {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(430px,.9fr);
    gap:18px;
    align-items:center;
    padding:16px;
    border:1px solid #dce6ed;
    border-radius:13px;
    background:#fbfdfe;
}
.checklist-main { display:flex; gap:12px; min-width:0; }
.status-dot { flex:0 0 12px; width:12px; height:12px; margin-top:5px; border-radius:50%; background:#9db0bc; }
.status-accepted .status-dot, .status-not_required .status-dot { background:#24945f; }
.status-needs_correction .status-dot { background:#c64848; }
.status-uploaded .status-dot, .status-under_review .status-dot { background:#d49a24; }
.checklist-main p { margin:5px 0; color:#526c7d; }
.checklist-main small { color:#728896; }
.checklist-status-form { display:grid; grid-template-columns:170px minmax(140px,1fr) auto; gap:8px; }
.checklist-status-form select, .checklist-status-form input { min-width:0; }
.new-request-box { margin-top:18px; border-top:1px solid #dce6ed; padding-top:16px; scroll-margin-top:90px; }
.new-request-box summary { cursor:pointer; color:#174f73; font-weight:800; }
.request-form { display:grid; grid-template-columns:1fr 1.3fr 1fr; gap:14px; margin-top:16px; }
.request-form label { display:grid; gap:7px; font-weight:700; color:#35586d; }
.request-form .wide-field { grid-column:1 / -1; }
.request-form .button { justify-self:start; }

/* Könyvelői gyorskereső és napi munkaközpont */
.dashboard-search-panel {
    margin-bottom:22px;
    border:1px solid #cfdfe8;
    border-radius:18px;
    background:linear-gradient(135deg,#ffffff,#eef6fa);
    overflow:hidden;
}
.dashboard-search-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(360px,.8fr); gap:24px; align-items:end; padding:22px; }
.dashboard-search-form label { display:block; margin-top:6px; color:#4f6b7c; }
.dashboard-search-controls { display:flex; gap:10px; }
.dashboard-search-controls input { flex:1; min-width:0; min-height:48px; }
.dashboard-search-results { display:grid; gap:1px; border-top:1px solid #d8e5ec; background:#d8e5ec; }
.dashboard-client-result { display:flex; justify-content:space-between; gap:18px; align-items:center; padding:14px 22px; background:#fff; color:#183d57; text-decoration:none; }
.dashboard-client-result:hover { background:#f5fafc; }
.dashboard-client-result strong, .dashboard-client-result small { display:block; }
.dashboard-client-result small { margin-top:3px; color:#718795; }
.result-open, .work-open, .task-open { white-space:nowrap; font-weight:800; color:#1d668a; }
.work-center-panel { margin-bottom:22px; }
.work-item-list { display:grid; gap:9px; }
.work-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:13px; align-items:center; padding:14px 15px; border:1px solid #dce6ed; border-radius:12px; color:#173b57; text-decoration:none; background:#fbfdfe; }
.work-item:hover { border-color:#9fc1d3; background:#f3f9fc; }
.work-priority-dot { width:11px; height:11px; border-radius:50%; background:#d39a2a; }
.work-item.status-needs_correction .work-priority-dot { background:#c44848; }
.work-item-copy strong, .work-item-copy span, .work-item-copy small { display:block; }
.work-item-copy span { margin-top:3px; }
.work-item-copy small { margin-top:4px; color:#738997; }
.work-clear-state { display:flex; gap:14px; align-items:center; padding:18px; border-radius:13px; background:#edf9f2; color:#17643b; }
.work-clear-state > span { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#26965f; color:#fff; font-weight:900; }
.work-clear-state p { margin:3px 0 0; }

/* Ügyféloldali teendők */
.client-portal-task-hero { display:flex; justify-content:space-between; gap:24px; align-items:center; margin-bottom:20px; padding:24px; border-radius:18px; background:linear-gradient(135deg,#153f5d,#1b6488); color:#fff; }
.client-portal-task-hero .eyebrow, .client-portal-task-hero p { color:#dbeaf2; }
.client-portal-task-hero h2 { margin:5px 0 7px; }
.client-task-panel { margin-bottom:20px; }
.client-task-list { display:grid; gap:10px; }
.client-task-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:13px; padding:15px; align-items:start; border:1px solid #dce6ed; border-radius:13px; background:#fbfdfe; color:#173b57; text-decoration:none; }
.client-task-item.status-needs_correction { border-color:#e5b5b5; background:#fff7f7; }
.client-task-item strong, .client-task-item small { display:block; }
.client-task-item small { margin-top:4px; color:#6f8594; }
.client-task-item p { margin:7px 0 0; color:#526c7d; }
.client-task-item .task-note { padding:8px 10px; border-radius:8px; background:#fff1d8; color:#775311; }

@media (max-width: 1100px) {
    .client-work-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .checklist-item { grid-template-columns:1fr; }
    .dashboard-search-form { grid-template-columns:1fr; }
}

@media (max-width: 700px) {
    .client-action-bar { position:static; margin-top:0; display:grid; grid-template-columns:1fr 1fr; }
    .client-action-bar form, .client-action-bar .client-action { width:100%; }
    .client-work-summary { grid-template-columns:1fr 1fr; }
    .checklist-status-form { grid-template-columns:1fr; }
    .request-form { grid-template-columns:1fr; }
    .request-form .wide-field { grid-column:auto; }
    .period-switcher { width:100%; flex-wrap:wrap; }
    .section-heading { align-items:flex-start; }
    .dashboard-search-controls { flex-direction:column; }
    .work-item, .client-task-item { grid-template-columns:auto minmax(0,1fr); }
    .work-open, .task-open { grid-column:2; }
    .client-portal-task-hero { align-items:flex-start; flex-direction:column; }
}

/* Ügyféladatlap műveleti sáv és ellenőrzőlista */
.client-action-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -14px 0 24px;
    padding: 12px;
    border: 1px solid #d7e3eb;
    border-radius: 16px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 10px 30px rgba(31,63,84,.08);
    backdrop-filter: blur(10px);
}
.client-action-bar form { margin: 0; }
.client-action {
    display: inline-flex;
    min-height: 42px;
    padding: 0 15px;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbdbe5;
    border-radius: 10px;
    background: #fff;
    color: #173b57;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.client-action:hover { background: #edf5f9; }
.client-action.warning { border-color: #ebc875; background: #fff9e9; color: #80590b; }
.client-action.success { border-color: #a9d9bf; background: #edf9f2; color: #17643b; }
.client-work-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.client-work-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid #d8e4ec;
    border-radius: 15px;
    background: #fff;
}
.client-work-card > span { display:block; margin-bottom: 9px; color:#647b8c; font-size:.9rem; }
.client-work-card strong { display:block; color:#153a55; font-size:1.35rem; }
.client-work-card small { display:block; margin-top:7px; color:#6c8190; }
.mini-progress { height:7px; margin-top:12px; overflow:hidden; border-radius:999px; background:#e8eff4; }
.mini-progress span { display:block; height:100%; border-radius:inherit; background:#1d7452; }
.checklist-panel { scroll-margin-top: 90px; }
.period-switcher { display:flex; gap:8px; align-items:center; }
.period-switcher select { min-height:42px; }
.checklist-list { display:grid; gap:10px; }
.checklist-item {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(430px,.9fr);
    gap:18px;
    align-items:center;
    padding:16px;
    border:1px solid #dce6ed;
    border-radius:13px;
    background:#fbfdfe;
}
.checklist-main { display:flex; gap:12px; min-width:0; }
.status-dot { flex:0 0 12px; width:12px; height:12px; margin-top:5px; border-radius:50%; background:#9db0bc; }
.status-accepted .status-dot, .status-not_required .status-dot { background:#24945f; }
.status-needs_correction .status-dot { background:#c64848; }
.status-uploaded .status-dot, .status-under_review .status-dot { background:#d49a24; }
.checklist-main p { margin:5px 0; color:#526c7d; }
.checklist-main small { color:#728896; }
.checklist-status-form { display:grid; grid-template-columns:170px minmax(140px,1fr) auto; gap:8px; }
.checklist-status-form select, .checklist-status-form input { min-width:0; }
.new-request-box { margin-top:18px; border-top:1px solid #dce6ed; padding-top:16px; scroll-margin-top:90px; }
.new-request-box summary { cursor:pointer; color:#174f73; font-weight:800; }
.request-form { display:grid; grid-template-columns:1fr 1.3fr 1fr; gap:14px; margin-top:16px; }
.request-form label { display:grid; gap:7px; font-weight:700; color:#35586d; }
.request-form .wide-field { grid-column:1 / -1; }
.request-form .button { justify-self:start; }

/* Könyvelői gyorskereső és napi munkaközpont */
.dashboard-search-panel {
    margin-bottom:22px;
    border:1px solid #cfdfe8;
    border-radius:18px;
    background:linear-gradient(135deg,#ffffff,#eef6fa);
    overflow:hidden;
}
.dashboard-search-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(360px,.8fr); gap:24px; align-items:end; padding:22px; }
.dashboard-search-form label { display:block; margin-top:6px; color:#4f6b7c; }
.dashboard-search-controls { display:flex; gap:10px; }
.dashboard-search-controls input { flex:1; min-width:0; min-height:48px; }
.dashboard-search-results { display:grid; gap:1px; border-top:1px solid #d8e5ec; background:#d8e5ec; }
.dashboard-client-result { display:flex; justify-content:space-between; gap:18px; align-items:center; padding:14px 22px; background:#fff; color:#183d57; text-decoration:none; }
.dashboard-client-result:hover { background:#f5fafc; }
.dashboard-client-result strong, .dashboard-client-result small { display:block; }
.dashboard-client-result small { margin-top:3px; color:#718795; }
.result-open, .work-open, .task-open { white-space:nowrap; font-weight:800; color:#1d668a; }
.work-center-panel { margin-bottom:22px; }
.work-item-list { display:grid; gap:9px; }
.work-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:13px; align-items:center; padding:14px 15px; border:1px solid #dce6ed; border-radius:12px; color:#173b57; text-decoration:none; background:#fbfdfe; }
.work-item:hover { border-color:#9fc1d3; background:#f3f9fc; }
.work-priority-dot { width:11px; height:11px; border-radius:50%; background:#d39a2a; }
.work-item.status-needs_correction .work-priority-dot { background:#c44848; }
.work-item-copy strong, .work-item-copy span, .work-item-copy small { display:block; }
.work-item-copy span { margin-top:3px; }
.work-item-copy small { margin-top:4px; color:#738997; }
.work-clear-state { display:flex; gap:14px; align-items:center; padding:18px; border-radius:13px; background:#edf9f2; color:#17643b; }
.work-clear-state > span { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#26965f; color:#fff; font-weight:900; }
.work-clear-state p { margin:3px 0 0; }

/* Ügyféloldali teendők */
.client-portal-task-hero { display:flex; justify-content:space-between; gap:24px; align-items:center; margin-bottom:20px; padding:24px; border-radius:18px; background:linear-gradient(135deg,#153f5d,#1b6488); color:#fff; }
.client-portal-task-hero .eyebrow, .client-portal-task-hero p { color:#dbeaf2; }
.client-portal-task-hero h2 { margin:5px 0 7px; }
.client-task-panel { margin-bottom:20px; }
.client-task-list { display:grid; gap:10px; }
.client-task-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:13px; padding:15px; align-items:start; border:1px solid #dce6ed; border-radius:13px; background:#fbfdfe; color:#173b57; text-decoration:none; }
.client-task-item.status-needs_correction { border-color:#e5b5b5; background:#fff7f7; }
.client-task-item strong, .client-task-item small { display:block; }
.client-task-item small { margin-top:4px; color:#6f8594; }
.client-task-item p { margin:7px 0 0; color:#526c7d; }
.client-task-item .task-note { padding:8px 10px; border-radius:8px; background:#fff1d8; color:#775311; }

@media (max-width: 1100px) {
    .client-work-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .checklist-item { grid-template-columns:1fr; }
    .dashboard-search-form { grid-template-columns:1fr; }
}

@media (max-width: 700px) {
    .client-action-bar { position:static; margin-top:0; display:grid; grid-template-columns:1fr 1fr; }
    .client-action-bar form, .client-action-bar .client-action { width:100%; }
    .client-work-summary { grid-template-columns:1fr 1fr; }
    .checklist-status-form { grid-template-columns:1fr; }
    .request-form { grid-template-columns:1fr; }
    .request-form .wide-field { grid-column:auto; }
    .period-switcher { width:100%; flex-wrap:wrap; }
    .section-heading { align-items:flex-start; }
    .dashboard-search-controls { flex-direction:column; }
    .work-item, .client-task-item { grid-template-columns:auto minmax(0,1fr); }
    .work-open, .task-open { grid-column:2; }
    .client-portal-task-hero { align-items:flex-start; flex-direction:column; }
}

/* Dokumentumteendő gyorsműveletek */
.client-task-item{display:block}
.client-task-link{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:start;color:inherit;text-decoration:none;padding:18px}
.client-task-actions{display:flex;flex-wrap:wrap;gap:8px;padding:0 18px 18px 46px}
.client-task-actions form{margin:0}
.button.compact{padding:8px 12px;font-size:.86rem;min-height:auto}
.button.ghost{background:transparent;border:1px solid #c8d7e1;color:#27475d}
.document-profile-box{margin-top:20px;border-top:1px solid #dce7ed;padding-top:16px}
.document-profile-box summary{cursor:pointer;font-weight:700}
.document-preference-list{display:grid;gap:8px;margin-top:14px}
.document-preference-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 14px;border:1px solid #dce7ed;border-radius:12px;background:#f8fbfc}
.document-preference-row span{display:grid;gap:3px}
.document-preference-row small{color:#667b89}
@media(max-width:760px){.client-task-link{grid-template-columns:auto 1fr}.client-task-link .task-open{grid-column:2}.client-task-actions{padding-left:18px;display:grid}.client-task-actions button{width:100%}.document-preference-row{align-items:stretch;flex-direction:column}.document-preference-row button{width:100%}}

/* Client portal document requests – compact, period-aware layout */
.client-task-panel{padding:24px}
.client-task-heading{align-items:flex-start;margin-bottom:22px;padding-bottom:18px;border-bottom:1px solid #e3ebf0}
.client-task-heading h2{margin:4px 0 6px}
.client-request-section+.client-request-section{margin-top:24px;padding-top:22px;border-top:1px solid #e3ebf0}
.client-request-section-title{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:12px}
.client-request-section-title h3{margin:0;font-size:17px;color:#173b57}
.client-request-section-title>span{font-size:13px;font-weight:700;color:#607888;background:#eef4f7;padding:5px 9px;border-radius:999px}
.client-request-overdue-label{display:inline-block;margin-bottom:4px;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#a05a16}
.client-request-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.client-request-card{display:flex;flex-direction:column;justify-content:space-between;min-width:0;padding:17px;border:1px solid #dbe6ec;border-radius:14px;background:#fff;box-shadow:0 3px 12px rgba(20,56,81,.035)}
.client-request-card.status-needs_correction{border-color:#e4b9b9;background:#fffafa}
.client-request-main{display:flex;gap:12px;min-width:0}
.client-request-icon{flex:0 0 30px;width:30px;height:30px;display:grid;place-items:center;border-radius:9px;background:#e9f4f7;color:#12657b;font-weight:900}
.client-request-card.status-needs_correction .client-request-icon{background:#f9e5e5;color:#a12f2f}
.client-request-copy{min-width:0;flex:1}
.client-request-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.client-request-heading h3{margin:1px 0 0;font-size:16px;line-height:1.3;color:#143b57}
.client-request-status{flex:0 0 auto;font-size:11px;font-weight:700;color:#597283;background:#f0f5f7;padding:4px 7px;border-radius:999px}
.status-needs_correction .client-request-status{color:#9a3030;background:#fae7e7}
.client-request-period{margin:5px 0 0;font-size:13px;color:#748895}
.client-request-description{margin:9px 0 0;color:#536d7d;font-size:14px}
.client-request-note{margin:10px 0 0;padding:9px 10px;border-radius:9px;background:#fff3dc;color:#75531a;font-size:13px}
.client-request-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:15px;padding-top:13px;border-top:1px solid #edf2f4}
.client-request-actions form{margin:0}
.client-request-actions .button{min-height:35px;padding:8px 12px;font-size:13px}
.client-request-text-action{appearance:none;border:0;background:transparent;padding:7px 4px;color:#527083;font:inherit;font-size:13px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.client-request-text-action:hover{color:#173b57}
.client-request-previous{padding:18px;border:1px solid #f0dcc4;border-radius:14px;background:#fffaf4}
@media(max-width:900px){.client-request-grid{grid-template-columns:1fr}}
@media(max-width:620px){.client-task-panel{padding:18px}.client-task-heading,.client-request-section-title,.client-request-heading{align-items:stretch;flex-direction:column}.client-task-heading>a{width:100%}.client-request-status{align-self:flex-start}.client-request-actions{display:grid;grid-template-columns:1fr}.client-request-actions .button,.client-request-actions form,.client-request-actions button{width:100%}.client-request-text-action{text-align:left}}


/* Operations package v5 */
.toggle-row{display:flex!important;gap:14px;align-items:flex-start;padding:16px;border:1px solid #d8e4ec;border-radius:12px}.toggle-row input{width:auto;margin-top:4px}.toggle-row span{display:grid;gap:4px}.toggle-row small{color:#647b8c}.calendar-list{display:grid;gap:10px}.calendar-item{display:grid;grid-template-columns:130px 1fr;gap:18px;padding:15px;border:1px solid #dbe6ed;border-radius:12px}.calendar-item time{font-weight:800;color:#174f73}.calendar-item p{margin:4px 0 0;color:#647b8c}@media(max-width:680px){.calendar-item{grid-template-columns:1fr}}

.saved-filter-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.saved-filter-chip{display:inline-flex;align-items:center;border:1px solid #cbdbe5;border-radius:999px;background:#f7fafc}.saved-filter-chip a{padding:7px 10px;text-decoration:none}.saved-filter-chip form{display:inline}.saved-filter-chip button{border:0;background:transparent;padding:7px 9px;cursor:pointer}.save-filter-form{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}.checkbox-inline{display:flex;align-items:center;gap:7px}.checkbox-inline input{width:auto}

/* ========================================
   v5 – egységes desktop/mobile navigáció
======================================== */
.brand-mark,
.user-avatar,
.mobile-user-avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: #163f5b;
    color: #fff;
    font-weight: 900;
}

.brand-mark {
    width: 34px;
    height: 34px;
    font-size: .95rem;
}

.brand-name { white-space: nowrap; }
.topbar-actions { display: none; }
.mobile-account-nav { display: none; }

@media (min-width: 1101px) {
    .topbar {
        min-height: 68px;
        border-top: 3px solid #c9daf0;
    }

    .topbar-inner {
        width: min(calc(100% - 40px), 1480px);
        max-width: 1480px;
        min-height: 65px;
        grid-template-columns: minmax(220px, auto) minmax(0, 1fr) auto;
        column-gap: 24px;
    }

    .topbar .brand-block { gap: 10px; }
    .brand { display: inline-flex; align-items: center; gap: 10px; }
    .brand-context { max-width: 175px; font-size: .72rem; }

    .role-nav {
        display: block;
        min-width: 0;
        width: auto;
    }

    .role-nav-links {
        justify-content: center;
        gap: 2px;
    }

    .role-nav .nav-link,
    .role-nav-links .button {
        min-height: 65px;
        padding: 0 11px;
        font-size: .84rem;
    }

    .role-nav .nav-link.active::after {
        right: 11px;
        bottom: 7px;
        left: 11px;
    }

    .topbar-actions {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .header-quick-action {
        display: inline-flex;
        min-height: 40px;
        padding: 0 14px;
        align-items: center;
        gap: 7px;
        border-radius: 10px;
        background: #153f5d;
        color: #fff;
        font-size: .84rem;
        font-weight: 800;
        text-decoration: none;
        white-space: nowrap;
    }

    .header-quick-action:hover { background: #0e334d; color: #fff; }
    .header-quick-action span { font-size: 1.15rem; line-height: 1; }

    .user-menu { position: relative; }
    .user-menu-toggle {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        min-width: 178px;
        min-height: 46px;
        padding: 5px 9px 5px 6px;
        align-items: center;
        gap: 9px;
        border: 1px solid #d7e2e9;
        border-radius: 12px;
        background: #fff;
        color: #173b57;
        cursor: pointer;
        text-align: left;
    }

    .user-menu-toggle:hover,
    .user-menu-toggle[aria-expanded="true"] { background: #f4f8fa; border-color: #b9ccd8; }
    .user-avatar { width: 34px; height: 34px; }
    .user-menu-copy { display: grid; min-width: 0; }
    .user-menu-copy strong,
    .user-menu-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .user-menu-copy strong { font-size: .82rem; }
    .user-menu-copy small { color: #6c8291; font-size: .68rem; }
    .user-menu-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

    .user-menu-panel {
        position: absolute;
        top: calc(100% + 9px);
        right: 0;
        z-index: 40;
        width: 250px;
        padding: 8px;
        border: 1px solid #d7e2e9;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 18px 44px rgba(17, 49, 71, .18);
    }

    .user-menu-panel[hidden] { display: none; }
    .user-menu-header { display: grid; gap: 3px; padding: 10px 11px 12px; border-bottom: 1px solid #e4ebef; }
    .user-menu-header small { overflow: hidden; color: #6b8190; text-overflow: ellipsis; }
    .user-menu-panel > a,
    .user-menu-panel form button {
        display: flex;
        width: 100%;
        min-height: 40px;
        padding: 9px 11px;
        align-items: center;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #173b57;
        font: inherit;
        font-size: .86rem;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }
    .user-menu-panel > a:hover,
    .user-menu-panel form button:hover { background: #f1f6f8; color: #15506f; }
    .user-menu-panel form { margin: 5px 0 0; padding-top: 5px; border-top: 1px solid #e4ebef; }
    .user-menu-panel form button { color: #9a3434; }

    .mobile-nav-heading,
    .mobile-account-nav,
    .role-nav > .logout-form { display: none !important; }
}

@media (max-width: 1260px) and (min-width: 1101px) {
    .brand-context { display: none; }
    .topbar-inner { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 16px; }
    .role-nav .nav-link { padding-right: 8px; padding-left: 8px; font-size: .8rem; }
    .header-quick-action { padding-right: 11px; padding-left: 11px; }
    .user-menu-toggle { min-width: 48px; }
    .user-menu-copy { display: none; }
}

@media (max-width: 1100px) {
    .topbar-actions { display: none !important; }
    .brand { display: inline-flex; align-items: center; gap: 9px; }
    .brand-mark { width: 32px; height: 32px; }
    .brand-context { display: none; }

    .mobile-nav-heading {
        display: flex;
        gap: 11px;
        align-items: center;
        padding: 0 4px 18px;
        border-bottom: 1px solid #e0e9ee;
    }
    .mobile-nav-heading > span:last-child { display: grid; min-width: 0; gap: 2px; }
    .mobile-nav-heading strong,
    .mobile-nav-heading small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-nav-heading small { color: #6a8292; }
    .mobile-user-avatar { width: 40px; height: 40px; }

    .role-nav-links { display: grid; gap: 4px; padding: 14px 0; }
    .role-nav .nav-link.active { background: #eaf3f7; color: #123f5c; font-weight: 800; }
    .role-nav .nav-link.active::after { content: none !important; }

    .mobile-account-nav {
        display: grid;
        gap: 4px;
        margin-top: auto;
        padding-top: 16px;
        border-top: 1px solid #e0e9ee;
    }
    .mobile-nav-section-title {
        padding: 0 12px 7px;
        color: #6a8292;
        font-size: .7rem;
        font-weight: 900;
        letter-spacing: .08em;
        text-transform: uppercase;
    }
    .mobile-account-nav .logout-form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid #edf2f4; }
    .mobile-account-nav .logout-link { color: #a13c3c; }
}

@media (max-width: 520px) {
    .brand-name { font-size: .94rem; }
    .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
    .topbar-inner { min-height: 60px; }
    .topbar { min-height: 60px; }
    .role-nav { padding-top: 70px; }
}

.profile-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-color: #e7bcbc;
    background: #fffafa;
}
.profile-danger-zone h2 { margin: 5px 0 6px; color: #8d2929; }
.profile-danger-zone p { max-width: 760px; }
@media (max-width: 700px) {
    .profile-danger-zone { align-items: stretch; flex-direction: column; }
    .profile-danger-zone .button { width: 100%; }
}

/* E-Iroda csoportosított könyvelői navigáció */
.nav-group {
    position: relative;
    margin: 0;
}

.nav-group > summary {
    list-style: none;
}

.nav-group > summary::-webkit-details-marker {
    display: none;
}

.nav-group-toggle {
    display: inline-flex;
    min-height: 65px;
    padding: 0 11px;
    align-items: center;
    gap: 7px;
    color: #173b57;
    font-size: .84rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.nav-group-toggle::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 1.7px solid currentColor;
    border-bottom: 1.7px solid currentColor;
    transform: rotate(45deg);
    transition: transform .18s ease, margin .18s ease;
}

.nav-group[open] .nav-group-toggle::after {
    margin-top: 4px;
    transform: rotate(225deg);
}

.nav-group.active .nav-group-toggle,
.nav-group[open] .nav-group-toggle,
.nav-group-toggle:hover {
    color: #087eae;
}

.nav-group.active .nav-group-toggle::before {
    content: '';
    position: absolute;
    right: 11px;
    bottom: 7px;
    left: 11px;
    height: 3px;
    border-radius: 999px;
    background: #0b8fc1;
}

.nav-group-menu {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    z-index: 120;
    display: grid;
    min-width: 245px;
    padding: 8px;
    gap: 3px;
    border: 1px solid #d7e2e9;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(17, 49, 71, .18);
}

.nav-sub-link {
    display: flex;
    min-height: 40px;
    padding: 9px 11px;
    align-items: center;
    border-radius: 8px;
    color: #173b57;
    font-size: .84rem;
    font-weight: 650;
    text-decoration: none;
    white-space: normal;
}

.nav-sub-link:hover {
    background: #f1f6f8;
    color: #15506f;
}

.nav-sub-link.active {
    background: #eaf3f7;
    color: #123f5c;
    font-weight: 850;
}

.user-menu-section {
    display: block;
    padding: 10px 11px 4px;
    color: #718694;
    font-size: .67rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.mobile-nav-section-title.account-subsection {
    padding-top: 14px;
}

.module-coming-soon {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    max-width: 900px;
}

.module-coming-soon-icon {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border-radius: 18px;
    background: #eaf3f7;
    color: #15506f;
    font-size: 1.55rem;
    font-weight: 900;
}

.module-coming-soon h2 {
    margin: 12px 0 8px;
}

.module-coming-soon-features {
    margin: 20px 0;
    padding: 16px 18px;
    border-radius: 12px;
    background: #f6f9fb;
}

.module-coming-soon-features ul {
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .nav-group {
        width: 100%;
    }

    .nav-group-toggle {
        width: 100%;
        min-height: 44px;
        padding: 10px 12px;
        justify-content: space-between;
        border-radius: 9px;
    }

    .nav-group.active .nav-group-toggle,
    .nav-group[open] .nav-group-toggle {
        background: #eaf3f7;
        color: #123f5c;
        font-weight: 850;
    }

    .nav-group.active .nav-group-toggle::before {
        content: none;
    }

    .nav-group-menu {
        position: static;
        min-width: 0;
        margin: 3px 0 7px;
        padding: 3px 0 3px 14px;
        border: 0;
        border-left: 2px solid #d8e5eb;
        border-radius: 0;
        box-shadow: none;
    }

    .nav-sub-link {
        min-height: 40px;
        padding: 9px 12px;
    }
}

@media (max-width: 640px) {
    .module-coming-soon {
        grid-template-columns: 1fr;
    }
}
