:root {
    --bg-deep: #eef1f6;
    --bg-panel: #f7f8fb;
    --bg-elevated: #ffffff;
    --border: rgba(15, 23, 42, 0.1);
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #da6329;
    --accent-dim: rgba(218, 99, 41, 0.12);
    --accent-strong: #b84f1c;
    --accent-hover: #e8793a;
    --warning: #c27803;
    --danger: #c0392b;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 18px 48px rgba(15, 23, 42, 0.1);
    --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
    --sidebar-w: 280px;
    --sidebar-collapsed-w: 80px;
    --font-display: "Sora", system-ui, sans-serif;
    --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
    --ink: #0b1220;
    --surface-glass: rgba(255, 255, 255, 0.78);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text);
    line-height: 1.5;
}

.muted {
    color: var(--text-muted);
}

.small {
    font-size: 0.85rem;
}

code {
    font-size: 0.9em;
    padding: 0.1em 0.35em;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.06);
}

.login-body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 12% 18%, rgba(218, 99, 41, 0.22), transparent 58%),
        radial-gradient(ellipse 50% 40% at 88% 8%, rgba(59, 130, 246, 0.12), transparent 55%),
        radial-gradient(ellipse 45% 35% at 70% 85%, rgba(218, 99, 41, 0.1), transparent 60%),
        linear-gradient(155deg, #0b1220 0%, #152038 42%, #1a2740 100%);
    z-index: 0;
}

.login-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 75% 70% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}

.login-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.06), transparent 28%),
        radial-gradient(circle at 78% 62%, rgba(218, 99, 41, 0.12), transparent 24%);
    animation: loginGlow 10s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes loginGlow {
    from { opacity: 0.7; transform: translate3d(0, 0, 0); }
    to { opacity: 1; transform: translate3d(12px, -8px, 0); }
}

.login-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: clamp(1.25rem, 4vw, 3rem);
    align-items: center;
    max-width: 1180px;
    margin: 0 auto;
}

@media (min-width: 900px) {
    .login-layout {
        grid-template-columns: 1.15fr 420px;
        gap: 3.5rem;
    }
}

@media (max-width: 640px) {
    .login-hero-title {
        max-width: none;
    }

    .login-hero-text {
        max-width: none;
        font-size: 0.98rem;
    }

    .login-card input[type="text"],
    .login-card input[type="password"],
    .login-card input[type="email"] {
        font-size: 16px;
    }
}

.login-hero {
    padding: 0.5rem 0;
    animation: loginRise 0.7s ease both;
}

@keyframes loginRise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-hero-logo {
    display: block;
    margin-bottom: 1.75rem;
    max-width: min(340px, 100%);
    height: auto;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.login-private-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #ffd7bf;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-private-kicker::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(218, 99, 41, 0.25);
}

.assignments-field-hidden {
    display: none !important;
}

.assignments-notes-first {
    white-space: pre-wrap;
}

.login-hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.85rem, 3.4vw, 2.55rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.85rem;
    line-height: 1.15;
    color: #fff;
    max-width: 16ch;
}

.login-hero-text {
    margin: 0 0 1.5rem;
    color: rgba(226, 232, 240, 0.82);
    font-size: 1.05rem;
    max-width: 42ch;
    line-height: 1.55;
}

.login-perks {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.55rem;
    color: rgba(226, 232, 240, 0.88);
    font-size: 0.95rem;
}

.login-perks li {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.login-perks li::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(218, 99, 41, 0.2);
}

.login-card-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: loginRise 0.7s ease 0.12s both;
}

.login-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: calc(var(--radius) + 6px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    padding: clamp(1.5rem, 4vw, 2rem);
    backdrop-filter: blur(18px);
}

.login-card-head {
    margin-bottom: 1.5rem;
}

.login-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-strong);
    margin-bottom: 0.35rem;
}

.login-title {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.field input {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder {
    color: rgba(90, 93, 107, 0.55);
}

.field input:focus {
    outline: none;
    border-color: rgba(218, 99, 41, 0.65);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.field-password-wrap {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    width: 100%;
}

.field-password-wrap input {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-right: 2.6rem;
}

.field-password-toggle {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: end;
    margin-right: 0.78rem;
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #94a3b8;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 3;
}

.field-password-toggle:hover {
    color: #475569;
}

.field-password-toggle:focus-visible {
    outline: none;
    color: #334155;
    box-shadow: none;
}

.field-password-icon {
    display: block;
    pointer-events: none;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: -0.25rem 0 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.login-remember input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--accent-strong, #da6329);
    cursor: pointer;
}

.form-error {
    min-height: 1.25rem;
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--danger);
}

.login-foot {
    text-align: center;
    margin: 0;
}

.login-foot-reset {
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    color: inherit;
}

.login-foot a.login-foot-reset,
.login-foot a {
    color: #fff;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.login-foot a:hover,
.login-foot a.login-foot-reset:hover {
    color: var(--accent);
}

.login-reset-ok {
    margin: 0 0 1.1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.9rem;
    line-height: 1.5;
}

.login-reset-err {
    margin: 0 0 1.1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    box-shadow: 0 10px 28px rgba(218, 99, 41, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    box-shadow: 0 14px 36px rgba(218, 99, 41, 0.45);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: #fff;
    color: var(--accent-strong);
    border-color: rgba(218, 99, 41, 0.45);
}

.btn-secondary:hover {
    background: rgba(218, 99, 41, 0.08);
}

.btn-block {
    width: 100%;
    padding: 0.95rem 1.25rem;
    font-size: 1rem;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.04);
}

.btn-excel {
    background: linear-gradient(135deg, #107c41 0%, #0f6e3a 100%);
    color: #fff;
    border-color: #0d6435;
    box-shadow: 0 8px 20px rgba(16, 124, 65, 0.3);
}

.btn-excel:hover {
    background: linear-gradient(135deg, #0f6e3a 0%, #0d6435 100%);
    box-shadow: 0 12px 24px rgba(16, 124, 65, 0.38);
}

.license-panel {
    margin-top: 1rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
}

.license-panel.is-valid {
    border-color: rgba(22, 163, 74, 0.45);
    background: rgba(240, 253, 244, 0.9);
}

.license-panel.is-invalid {
    border-color: rgba(218, 99, 41, 0.35);
    background: rgba(254, 242, 242, 0.9);
}

.license-panel-title {
    margin: 0 0 0.25rem;
    font-weight: 700;
    font-size: 0.92rem;
}

.license-panel-text {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.license-panel-text + .license-panel-text {
    margin-top: 0.35rem;
}

.license-panel-text.is-success {
    color: #166534;
    font-weight: 600;
}

.license-panel-text.is-error {
    color: #b84f1c;
    font-weight: 600;
}

.license-panel-form {
    margin-top: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.dashboard-body {
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(218, 99, 41, 0.08), transparent 55%),
        radial-gradient(ellipse 45% 35% at 0% 100%, rgba(59, 130, 246, 0.06), transparent 50%),
        var(--bg-deep);
}

.dashboard-frame {
    display: flex;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #101826 0%, #0b1220 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: width 0.22s ease;
    z-index: 200;
    color: #e8eef6;
}

.sidebar--collapsed {
    width: var(--sidebar-collapsed-w);
}

.sidebar-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 0.75rem 1rem;
    padding-right: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(218, 99, 41, 0.14) 0%, transparent 100%);
}

.sidebar-toggle {
    position: absolute;
    top: 0.85rem;
    right: 0.7rem;
    z-index: 2;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(226, 232, 240, 0.75);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.sidebar-toggle:hover {
    color: #fff;
    border-color: rgba(218, 99, 41, 0.45);
    background: rgba(218, 99, 41, 0.18);
}

.sidebar-toggle-icon {
    display: block;
    width: 8px;
    height: 8px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 2px;
}

.sidebar--collapsed .sidebar-toggle-icon {
    transform: rotate(-135deg);
    margin-left: -2px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
    padding-right: 2.75rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.sidebar--collapsed .sidebar-brand {
    justify-content: center;
    width: 100%;
    padding-right: 0;
}

.sidebar--collapsed .sidebar-brand-text {
    display: none;
}

.sidebar-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: left center;
    background: #fff;
    border-radius: 10px;
    padding: 0.35rem 0.45rem;
}

.sidebar--collapsed .sidebar-logo {
    max-height: 2.25rem;
    max-width: 100%;
    object-position: center center;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.sidebar-brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-hover);
}

.sidebar-brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    padding: 0.85rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar-foot {
    flex-shrink: 0;
    margin-top: auto;
    padding: 0.85rem 0.65rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.nav-link,
.nav-link:link,
.nav-link:visited {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.78rem 0.9rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    color: #e8eef6;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}

.nav-link:hover,
.nav-link:hover:visited {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.nav-link.is-active,
.nav-link.is-active:visited {
    color: #fff;
    background: linear-gradient(90deg, rgba(218, 99, 41, 0.28), rgba(255, 255, 255, 0.06));
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-link-exit {
    color: rgba(226, 232, 240, 0.65);
}

.nav-link-exit:hover {
    color: #fff;
    background: rgba(218, 99, 41, 0.14);
}

.nav-icon {
    flex-shrink: 0;
    opacity: 1;
    color: inherit;
}

.sidebar--collapsed .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sidebar--collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar--collapsed .sidebar-head {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem 0.45rem 0.75rem;
    padding-right: 0.45rem;
    min-height: 0;
}

.sidebar--collapsed .sidebar-toggle {
    position: static;
    width: 100%;
}

.sidebar-nav .nav-link {
    position: relative;
}

.dashboard-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    padding-top: env(safe-area-inset-top, 0);
    overflow: hidden;
}

.top-bar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    padding: 0.55rem 0.95rem;
    background: rgba(255, 255, 255, 0.94);
    border: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: blur(14px);
}

.top-bar-lead {
    min-width: 0;
    padding-left: 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1 1 12rem;
}

.top-bar-titles {
    min-width: 0;
    flex: 1;
}

.top-bar-title {
    font-family: var(--font-display);
    font-size: clamp(1.02rem, 2.2vw, 1.2rem);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-left: auto;
    flex: 0 1 auto;
    min-width: 0;
}

.top-logout-icon {
    flex-shrink: 0;
    opacity: 0.92;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.01em;
    padding: 0.48rem 0.95rem;
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    font-variant-numeric: tabular-nums;
}

.user-chip-license.is-valid {
    border-color: rgba(22, 163, 74, 0.38);
    color: #166534;
    background: rgba(240, 253, 244, 0.9);
}

.user-chip-license.is-invalid {
    border-color: rgba(218, 99, 41, 0.45);
    color: #991b1b;
    background: rgba(254, 242, 242, 0.92);
}

a.user-chip-logout {
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

a.user-chip-logout:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(218, 99, 41, 0.45);
    box-shadow: 0 2px 8px rgba(30, 30, 40, 0.06);
}

a.user-chip-logout:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
}

.main-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
    background: var(--bg-panel);
    border: 0;
    border-radius: 0;
    padding: 0.7rem 0.9rem 0.85rem;
    box-shadow: none;
}

.panel {
    display: none;
}

.panel.is-visible {
    display: block;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.panel-lead {
    margin: 0 0 0.75rem;
}

.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    padding: 1.1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.stat-card.muted-card {
    opacity: 0.95;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-display);
}

.stat-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.table-shell {
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(30, 30, 40, 0.15);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.seg-btn {
    flex: 1 1 auto;
    min-width: 160px;
    padding: 0.65rem 1rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

a.seg-btn {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.finance-context-nav {
    margin-bottom: 0.7rem;
}

.seg-btn:hover {
    color: var(--text);
    border-color: rgba(218, 99, 41, 0.35);
}

.seg-btn.is-active {
    color: var(--accent-strong);
    background: rgba(218, 99, 41, 0.12);
    border-color: rgba(218, 99, 41, 0.4);
}

.seg-btn-primary {
    border-color: rgba(218, 99, 41, 0.4);
}

.seg-btn-primary.is-active {
    background: linear-gradient(135deg, rgba(218, 99, 41, 0.18), rgba(218, 99, 41, 0.1));
    color: var(--accent-strong);
}

.order-context {
    border-radius: var(--radius-sm);
    background: transparent;
    border: 0;
    padding: 0.55rem 0 0;
    min-height: 0;
}

.order-pane {
    display: none;
}

.order-pane.is-visible {
    display: block;
}

.order-pane p {
    margin: 0;
}

.new-order-shell {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 0.9rem;
}

.new-order-head h3 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
}

.new-order-head p {
    margin: 0 0 0.8rem;
}

.new-order-form {
    display: block;
}

.new-order-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.new-order-grid .field {
    min-width: 0;
}

.new-order-grid .field-span-2 {
    grid-column: span 2;
}

.new-order-grid .field input,
.new-order-grid .field select {
    width: 100%;
    padding: 0.72rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    background: #fff;
    color: var(--text);
}

.new-order-grid .field input:focus,
.new-order-grid .field select:focus {
    outline: none;
    border-color: rgba(218, 99, 41, 0.6);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.new-order-actions {
    margin-top: 0.8rem;
    display: flex;
    justify-content: flex-end;
}

.new-order-item-field {
    position: relative;
}

.new-order-item-cell {
    position: relative;
}

.new-order-table .new-order-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: min(560px, 100%);
    z-index: 300;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.16);
    max-height: 280px;
    overflow: auto;
    padding: 0.15rem 0;
}

.new-order-suggest-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: left;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    font: inherit;
    color: var(--text);
}

.new-order-suggest-item:last-child {
    border-bottom: 0;
}

.new-order-suggest-item:hover,
.new-order-suggest-item:focus-visible {
    background: rgba(218, 99, 41, 0.08);
    outline: none;
}

.new-order-suggest-main {
    display: block;
    font-weight: 600;
    white-space: normal;
    word-break: break-word;
}

.new-order-suggest-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.15rem;
    white-space: normal;
    word-break: break-word;
}

.new-order-status {
    margin: 0.6rem 0 0;
}

.new-order-status.is-error {
    color: #b84f1c;
}

.new-order-status.is-success {
    color: #166534;
}

.new-order-customer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}

.new-order-customer-name {
    font-weight: 700;
}

.new-order-customer-meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.new-order-table {
    width: 100%;
    table-layout: fixed;
}

.new-order-table tr.new-order-line {
    display: table-row;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    gap: 0;
    grid-template-columns: none;
}

.new-order-table td {
    vertical-align: top;
}

.new-order-table thead th {
    background: rgba(15, 23, 42, 0.06);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.new-order-table .new-order-qty {
    max-width: 5.5rem;
    text-align: center;
}

.new-order-table td[data-label="Τιμή (Με ΦΠΑ)"] input,
.new-order-table td[data-label="Τιμή Λιανικής (Με ΦΠΑ)"] input,
.new-order-table td[data-label="Τιμή Χονδρικής (Με ΦΠΑ)"] input,
.new-order-table td[data-label="Τιμή Αγοράς (Με ΦΠΑ)"] input,
.new-order-table td[data-label="ΤΙΜΗ ΑΓΟΡΑΣ (Με ΦΠΑ)"] input,
.new-order-table td[data-label="Κωδικός"] input {
    text-align: center;
}

.new-order-table td input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.65rem;
    font: inherit;
    color: var(--text);
    background: #fff;
}

.new-order-table td input:focus {
    outline: none;
    border-color: rgba(218, 99, 41, 0.6);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.new-order-table .new-order-item-cell {
    position: relative;
    min-width: 16rem;
}

.new-order-table .new-order-remove {
    white-space: nowrap;
}

.new-order-actions {
    margin-top: 0.25rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.new-order-confirm,
.new-order-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.new-order-confirm[hidden],
.new-order-success-overlay[hidden] {
    display: none !important;
}

.new-order-confirm-backdrop,
.new-order-success-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.56);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: default;
}

.new-order-confirm-dialog,
.new-order-success-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 26px 54px rgba(2, 6, 23, 0.28);
    padding: 1rem 1.05rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.new-order-confirm-title,
.new-order-success-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text);
}

.new-order-confirm-message,
.new-order-success-message {
    margin: 0.58rem 0 0.86rem;
    color: var(--muted);
}

.new-order-success-text {
    font-weight: 700;
}

.new-order-confirm-actions,
.new-order-success-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .new-order-confirm,
    .new-order-success-overlay {
        align-items: flex-start;
        padding-top: 1.25rem;
    }
}

body.new-order-modal-open {
    overflow: hidden;
}

.mobile-menu-btn {
    display: none;
    position: relative;
    flex-shrink: 0;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(35, 40, 55, 0.08);
}

.mobile-menu-btn::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 2px;
    background: var(--text);
    box-shadow:
        0 -6px 0 var(--text),
        0 6px 0 var(--text);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dashboard-frame--drawer-open .sidebar-backdrop {
    display: block;
}

@media (max-width: 1024px) {
    .dashboard-frame {
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100%;
        width: min(var(--sidebar-w), 88vw);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        padding-top: env(safe-area-inset-top, 0);
    }

    .sidebar.sidebar--open {
        transform: translateX(0);
    }

    .sidebar--collapsed:not(.sidebar--open) {
        width: min(var(--sidebar-w), 88vw);
    }

    .sidebar--collapsed.sidebar--open {
        width: min(var(--sidebar-w), 88vw);
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-brand {
        padding-right: 0;
    }

    .sidebar.sidebar--collapsed .nav-label {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        border: 0;
    }

    .sidebar .nav-label {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        border: 0;
        line-height: 1.25;
    }

    .sidebar .nav-link {
        justify-content: flex-start;
        align-items: flex-start;
    }

    .sidebar-head {
        flex-direction: row;
    }

    .sidebar-nav {
        padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0));
    }

    .b2b-overlay-main-pane.b2b-sn-picker-in-dialog {
        left: 0;
        z-index: 1200;
    }
}

.finance-error {
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: rgba(218, 99, 41, 0.08);
    border: 1px solid rgba(218, 99, 41, 0.25);
}

.finance-toolbar {
    margin-bottom: 1rem;
}

.finance-toolbar-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.65rem;
}

.finance-search {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.finance-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.finance-field-grow {
    flex: 1 1 200px;
}

.finance-field-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.finance-field input[type="date"],
.finance-customer-readonly {
    padding: 0.5rem 0.65rem;
    font-family: inherit;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    box-sizing: border-box;
    min-height: 42px;
}

.finance-customer-readonly {
    opacity: 0.95;
    cursor: default;
}

.finance-search .btn {
    box-sizing: border-box;
    min-height: 42px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.finance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.finance-pdf-icon {
    display: block;
    flex-shrink: 0;
}

/* Οικονομική καρτέλα: εικονίδιο εγγράφου + «Λήψη Καρτέλας» */
.finance-toolbar .finance-actions .documents-pdf-link.finance-toolbar-pdf-link,
.finance-toolbar .finance-actions .documents-pdf-link.finance-toolbar-pdf-link:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-sizing: border-box;
    margin: 0;
    padding: 0.4rem 0.65rem 0.4rem 0.5rem;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    background: rgba(15, 150, 240, 0.1);
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(15, 46, 110, 0.2);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.finance-toolbar .finance-actions .documents-pdf-link.finance-toolbar-pdf-link:hover {
    background: rgba(15, 150, 240, 0.16);
    box-shadow: inset 0 0 0 1px rgba(15, 46, 110, 0.32);
}

.finance-toolbar .finance-actions .documents-pdf-link.finance-toolbar-pdf-link:active {
    transform: scale(0.98);
}

.finance-toolbar .finance-actions .documents-pdf-link.finance-toolbar-pdf-link:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
}

.finance-toolbar-pdf-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.finance-toolbar .finance-actions .documents-pdf-link.finance-toolbar-pdf-link .documents-pdf-link-icon {
    display: block;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.documents-table td.documents-mk {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.documents-table th.documents-col-pdf,
.documents-table td.documents-col-pdf,
.orders-table th.orders-col-pdf,
.orders-table td.orders-col-pdf {
    text-align: left;
}

.finance-table.documents-table td .documents-pdf-link,
.finance-table.documents-table td .documents-pdf-link:visited,
.finance-table.orders-table td .documents-pdf-link,
.finance-table.orders-table td .documents-pdf-link:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    padding: 6px;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 10px;
    background: rgba(198, 40, 40, 0.08);
    text-decoration: none;
    cursor: pointer;
    vertical-align: middle;
    box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.18);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.finance-table.documents-table td .documents-pdf-link:hover,
.finance-table.orders-table td .documents-pdf-link:hover {
    background: rgba(198, 40, 40, 0.14);
    box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.28);
}

.finance-table.documents-table td .documents-pdf-link:active,
.finance-table.orders-table td .documents-pdf-link:active {
    transform: scale(0.96);
}

.finance-table.documents-table td .documents-pdf-link:focus-visible,
.finance-table.orders-table td .documents-pdf-link:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
}

.finance-table.documents-table td .documents-pdf-link-icon,
.finance-table.orders-table td .documents-pdf-link-icon {
    display: block;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    flex-shrink: 0;
    overflow: visible;
    border-radius: 4px;
}

.finance-table.orders-table td .orders-pdf-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.finance-total-bar {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.finance-total-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.finance-total-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.finance-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
}

/* Keep new-order suggestions fully visible above table/actions. */
.finance-table-wrap.new-order-table-wrap {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

/* Keep new order layout tall, similar to customer documents feel,
   even when only one item row exists. */
.new-order-shell form {
    display: flex;
    flex-direction: column;
    min-height: 560px;
}

.finance-table-wrap.new-order-table-wrap {
    min-height: 360px !important;
    display: block;
}

.new-order-table {
    min-height: 340px;
}

.new-order-actions {
    margin-top: auto !important;
    padding-top: 1rem;
}

.finance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.finance-table th,
.finance-table td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid rgba(30, 30, 40, 0.08);
    vertical-align: top;
}

.finance-table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.03);
}

.finance-table.documents-table th,
.finance-table.documents-table td,
.finance-table.orders-table th,
.finance-table.orders-table td {
    vertical-align: middle;
    line-height: 1.4;
}

.finance-row-muted td {
    background: rgba(0, 0, 0, 0.03);
    font-weight: 500;
}

.finance-row-strong td {
    font-weight: 700;
}

.finance-toolbar .finance-actions {
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .dashboard-content {
        padding: 0;
        gap: 0;
        padding-top: env(safe-area-inset-top, 0);
        min-width: 0;
        overflow: hidden;
    }

    .top-bar {
        padding: 0.5rem 0.7rem;
        gap: 0.5rem 0.65rem;
    }

    .top-actions {
        margin-left: auto;
        width: auto;
        max-width: 100%;
        justify-content: flex-end;
    }

    .main-stage {
        padding: 0.55rem 0.7rem 0.75rem;
    }

    .order-context {
        padding: 0.85rem;
    }

    .new-order-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .new-order-grid .field-span-2 {
        grid-column: 1 / -1;
    }

    .segmented {
        gap: 0.4rem;
    }

    .seg-btn {
        min-width: 0;
        flex: 1 1 calc(50% - 0.2rem);
    }

    .finance-search {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: end;
        gap: 0.6rem;
    }

    .finance-field-grow {
        grid-column: 1 / -1;
    }

    .finance-search .btn {
        width: 100%;
        grid-column: 1 / -1;
    }

    .finance-table {
        font-size: 0.82rem;
    }

    .finance-table th,
    .finance-table td {
        padding: 0.5rem 0.55rem;
    }
}

@media (max-width: 640px) {
    .top-bar-title {
        font-size: 1rem;
    }

    .user-chip {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    .seg-btn {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .finance-search {
        grid-template-columns: 1fr;
    }

    .finance-field-grow,
    .finance-search .btn {
        grid-column: auto;
    }

    .finance-field input[type="date"],
    .finance-customer-readonly {
        font-size: 0.95rem;
        padding: 0.58rem 0.65rem;
    }

    .main-stage {
        padding: 0.5rem 0.6rem 0.7rem;
    }

    .order-context {
        padding: 0.7rem;
    }

    .new-order-shell {
        padding: 0.8rem;
    }

    .new-order-grid {
        grid-template-columns: 1fr;
    }

    .new-order-grid .field-span-2 {
        grid-column: auto;
    }

    .new-order-actions {
        justify-content: stretch;
    }

    .new-order-actions .btn {
        width: 100%;
    }

    .finance-toolbar-title {
        font-size: 0.95rem;
    }

    .finance-table.documents-table td .documents-pdf-link,
    .finance-table.orders-table td .documents-pdf-link {
        width: 48px;
        height: 48px;
        padding: 5px;
    }

    .finance-table.documents-table td .documents-pdf-link-icon,
    .finance-table.orders-table td .documents-pdf-link-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        max-width: 36px;
        max-height: 36px;
    }
}

@media (max-width: 900px) {
    .finance-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .finance-table {
        border-collapse: separate;
        border-spacing: 0;
        background: transparent;
    }

    .finance-table thead {
        display: none;
    }

    .finance-table tbody,
    .finance-table tr,
    .finance-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .finance-table tr {
        margin-bottom: 0.75rem;
        padding: 0.6rem 0.7rem;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
    }

    .finance-table td {
        border: 0;
        border-bottom: 1px dashed rgba(30, 30, 40, 0.12);
        padding: 0.45rem 0;
        margin: 0;
        min-height: 34px;
        overflow-wrap: anywhere;
    }

    .finance-table td:last-child {
        border-bottom: 0;
    }

    .finance-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-bottom: 0.18rem;
    }

    .finance-table td.documents-col-pdf::before,
    .finance-table td.orders-col-pdf::before {
        margin-bottom: 0.35rem;
    }

    .finance-table .finance-row-muted td[colspan],
    .finance-table .finance-row-strong td[colspan] {
        text-align: left;
        font-weight: 600;
    }

    .finance-table .finance-row-muted td[colspan]::before,
    .finance-table .finance-row-strong td[colspan]::before {
        content: none;
    }

    .finance-table td:not([data-label])::before {
        content: none;
    }
}

/* --- New Order rebuilt layout (non-table, readable dropdown) --- */
.new-order-form-shell {
    display: block;
}

.new-order-form-shell .new-order-label {
    display: none;
}

.new-order-form-shell .new-order-field input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.65rem;
    font: inherit;
    color: var(--text);
    background: #fff;
}

.new-order-form-shell .new-order-field input:focus {
    outline: none;
    border-color: rgba(218, 99, 41, 0.6);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.new-order-form-shell .new-order-field input.new-order-item-purchase-price {
    font-weight: 700;
}

.new-order-lines {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.new-order-lines-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 128px 72px 108px 108px 130px;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
    padding: 0 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.new-order-lines-head .new-order-col-center,
.new-order-col-center {
    text-align: center;
}

.new-order-col-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.new-order-qty-cell .new-order-qty {
    max-width: 5.5rem;
    text-align: center;
}

.new-order-meta-readonly {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.new-order-lines > .new-order-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 128px 72px 108px 108px 130px;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 0.7rem;
}

.new-order-field {
    min-width: 0;
}

.new-order-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.new-order-item-cell {
    position: relative;
    min-width: 0;
}

.new-order-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    z-index: 300;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.16);
    max-height: 280px;
    overflow: auto;
    padding: 0.15rem 0;
}

.new-order-line-action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 42px;
}

.new-order-line-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
}

.new-order-line-actions .btn {
    min-height: 2.2rem;
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

.new-order-total-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 128px 72px 108px 108px 130px;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.35rem;
    padding: 0.85rem 0.7rem 0.95rem;
    border-top: 1px solid var(--border, #e5e7eb);
}

.new-order-total-label {
    grid-column: 1 / 5;
    text-align: right;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    padding-right: 0.35rem;
}

.new-order-total-tail {
    grid-column: 5 / 7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.new-order-total-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-strong, #b84f1c);
    white-space: nowrap;
}

.new-order-submit {
    min-height: 2.35rem;
    padding: 0.45rem 0.95rem;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .new-order-lines > .new-order-line {
        grid-template-columns: 1fr;
    }

    .new-order-lines > .new-order-line-action {
        justify-content: flex-start;
    }

    .new-order-total-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
        padding-top: 0.75rem;
    }

    .new-order-total-label {
        grid-column: 1;
        text-align: left;
        padding-right: 0;
    }

    .new-order-total-tail {
        grid-column: 1;
        justify-content: flex-start;
    }

    .new-order-total-value {
        text-align: left;
    }
}

.finance-field select.finance-select,
.finance-search select {
    width: 100%;
    min-height: 42px;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font: inherit;
    color: var(--text);
}

.assignments-table .assignments-col-actions {
    width: 12rem;
    text-align: center;
}

.assignments-col-actions-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.assignments-col-actions-form {
    display: inline-flex;
    margin: 0;
}

.assignments-col-actions .assignments-print-link,
.assignments-col-actions .assignments-edit-link,
.assignments-col-actions .assignments-open-tab-link,
.assignments-col-actions .assignments-delete-link {
    padding: 0.4rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
}

.assignments-col-actions .assignments-print-icon,
.assignments-col-actions .assignments-edit-icon,
.assignments-col-actions .assignments-open-tab-icon {
    width: 1.9rem;
    height: 1.9rem;
}

.assignments-col-actions .assignments-delete-link:hover {
    background: rgba(185, 28, 28, 0.08);
}

.assignments-manage-link {
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.assignments-manage-link:hover {
    text-decoration: underline;
}

.assignments-export {
    margin-top: 1rem;
}

.assignments-export-link {
    font-weight: 600;
    color: var(--accent);
}

.assignments-export-hint {
    font-size: 0.85rem;
}

.assignments-filters-shell {
    margin-bottom: 1.25rem;
}

.assignments-list-toolbar.finance-toolbar {
    margin-bottom: 0;
    padding: 1.15rem 1.25rem;
    background: var(--surface-elevated, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.assignments-list-toolbar .finance-toolbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.9rem;
    letter-spacing: -0.02em;
    font-family: var(--font-display, "Outfit", system-ui, sans-serif);
}

.assignments-search-filters {
    margin-bottom: 0;
}

.assignments-admin-toolbar .assignments-admin-filters-form {
    display: block;
}

.assignments-admin-primary-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.85rem;
    align-items: end;
    margin-bottom: 1.1rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.assignments-admin-primary-row .assignments-filter-field {
    flex: 0 0 auto;
    min-width: 9.5rem;
}

.assignments-admin-primary-row .assignments-filter-field-mk {
    min-width: 6rem;
    max-width: 6.6rem;
}

.assignments-admin-primary-row .assignments-filter-field-pel {
    min-width: 11.5rem;
    max-width: 12.5rem;
}

.assignments-admin-primary-row .assignments-filter-field-tech {
    min-width: 10.75rem;
    max-width: 11.25rem;
}

.assignments-filter-twin {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.65rem;
    align-items: end;
    min-width: 17.8rem;
}

.assignments-admin-primary-row .assignments-filter-twin {
    flex: 0 0 auto;
}

.assignments-filter-twin .assignments-filter-field-nested {
    margin: 0;
    min-width: 7.8rem;
}

.assignments-filter-twin .assignments-filter-field-status {
    min-width: 9.25rem;
}

.assignments-filter-twin .assignments-filter-field-warranty {
    min-width: 5.1rem;
}

.assignments-filter-twin .assignments-filter-field-searchbtn {
    min-width: 3.2rem;
}

.assignments-search-inline {
    min-height: 46px;
    width: 46px;
    min-width: 46px;
    padding: 0;
}

.assignments-filter-field-grow {
    grid-column: span 2;
    min-width: 0;
}

.assignments-filter-field-wide {
    grid-column: span 2;
    min-width: 0;
}

@media (max-width: 640px) {
    .assignments-filter-field-grow,
    .assignments-filter-field-wide {
        grid-column: span 1;
    }
}

.assignments-admin-toolbar .assignments-filter-input {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.assignments-admin-toolbar input.assignments-filter-input {
    padding: 0.58rem 0.72rem;
    border: 1px solid var(--border);
    background: #fff;
    font: inherit;
    color: var(--text);
}

.assignments-admin-toolbar select.assignments-filter-input {
    padding: 0.58rem 2rem 0.58rem 0.72rem;
    border: 1px solid var(--border);
    background: #fff;
    font: inherit;
    color: var(--text);
}

.assignments-admin-toolbar input.assignments-filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(26, 115, 229, 0.15);
}

.assignments-admin-toolbar select.assignments-filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(26, 115, 229, 0.15);
}

.assignments-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-top: 0.15rem;
}

.assignments-admin-actions-secondary {
    justify-content: flex-start;
}

/* Tasks filter toolbar — mobile layout */
@media (max-width: 900px) {
    .tasks-page-panel,
    .assignments-filters-shell {
        max-width: 100%;
        min-width: 0;
    }

    .assignments-list-toolbar.finance-toolbar {
        padding: 0.9rem 0.85rem;
    }

    .assignments-admin-primary-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex-wrap: wrap;
        overflow-x: visible;
        gap: 0.6rem;
        align-items: end;
        padding-bottom: 0;
    }

    /* iOS/Safari can keep a large intrinsic min-width for date inputs; force them to fit the grid cell. */
    .assignments-admin-primary-row .assignments-filter-input {
        max-width: 100%;
        min-width: 0;
    }

    .assignments-admin-primary-row input.assignments-filter-input[type="date"] {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
        overflow: hidden;
        background-clip: padding-box;
    }

    .assignments-admin-primary-row .assignments-filter-field,
    .assignments-admin-primary-row .assignments-filter-field-mk,
    .assignments-admin-primary-row .assignments-filter-field-pel,
    .assignments-admin-primary-row .assignments-filter-field-tech {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .assignments-admin-primary-row .assignments-filter-field-pel,
    .assignments-admin-primary-row .assignments-filter-field-tech {
        grid-column: 1 / -1;
    }

    .assignments-admin-primary-row .assignments-filter-twin {
        grid-column: 1 / -1;
        min-width: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.6rem;
        align-items: end;
    }

    .assignments-filter-twin .assignments-filter-field-nested,
    .assignments-filter-twin .assignments-filter-field-warranty,
    .assignments-filter-twin .assignments-filter-field-searchbtn {
        min-width: 0;
    }

    .assignments-admin-status-row .assignments-status-checkboxes {
        flex-wrap: wrap;
    }

    .assignments-admin-status-row .assignments-status-option {
        flex: 1 1 calc(50% - 0.4rem);
        min-width: min(100%, 9.5rem);
    }

    .assignments-admin-actions-secondary .btn {
        flex: 1 1 calc(50% - 0.35rem);
        min-width: 0;
        justify-content: center;
    }

    .assignments-filters-shell form.calendar-filters-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .assignments-filters-shell form.calendar-filters-row .finance-field,
    .assignments-filters-shell .calendar-field-month,
    .assignments-filters-shell .calendar-field-tech,
    .assignments-filters-shell .calendar-field-status {
        min-width: 0;
        width: 100%;
    }

    .assignments-filters-shell form.calendar-filters-row .btn,
    .assignments-filters-shell .calendar-nav-btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .assignments-list-toolbar.finance-toolbar {
        padding: 0.75rem 0.7rem;
    }

    .assignments-admin-primary-row {
        grid-template-columns: 1fr;
    }

    .assignments-admin-primary-row .assignments-filter-field-pel,
    .assignments-admin-primary-row .assignments-filter-field-tech {
        grid-column: auto;
    }

    /* Extra safety: keep native date control paint inside the card on iOS. */
    .assignments-list-toolbar.finance-toolbar {
        overflow: hidden;
    }

    .assignments-admin-status-row .assignments-status-option {
        flex: 1 1 100%;
    }

    .assignments-admin-actions-secondary {
        flex-direction: column;
        align-items: stretch;
    }

    .assignments-admin-actions-secondary .btn {
        width: 100%;
        flex: 1 1 auto;
    }

    .assignments-filters-shell form.calendar-filters-row {
        grid-template-columns: 1fr;
    }

    .assignments-filters-shell form.calendar-filters-row .btn,
    .assignments-filters-shell .calendar-nav-btn {
        grid-column: auto;
    }
}

@media (max-width: 900px) {
    .assignments-table-tasks-admin {
        border-spacing: 0;
    }

    .assignments-table-tasks-admin tbody tr td {
        background: transparent;
        border: 0;
        border-bottom: 1px dashed rgba(30, 30, 40, 0.12);
        border-radius: 0;
        box-shadow: none;
    }

    .assignments-table-tasks-admin tbody tr td:first-child,
    .assignments-table-tasks-admin tbody tr td:last-child {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .assignments-table-tasks-admin tbody tr:not(.finance-row-muted) td {
        box-shadow: none;
    }

    .assignments-table-tasks-admin tbody tr.assignments-row-editable:hover td {
        background: transparent;
        box-shadow: none;
    }
}

.assignments-btn-new-task {
    background: #9ca3af;
    border-color: #6b7280;
    color: #111827;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}

.assignments-btn-new-task:hover {
    background: #8f97a4;
    border-color: #5f6673;
    color: #0f172a;
}

.assignments-subtitle {
    margin: 0 0 0.75rem;
}

.assignments-table-shell.finance-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    background: var(--surface-elevated, #fff);
}

.assignments-table-shell .finance-table {
    margin: 0;
}

.assignments-flash {
    margin: 0.75rem 0;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    background: #e8f5e9;
    color: #1b5e20;
    font-weight: 500;
}

.assignments-sn {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.85rem;
}

.assignments-manage-link-muted {
    margin-left: 0.5rem;
    opacity: 0.85;
}

.assignments-table-admin td[data-label="Κατάσταση"] {
    font-weight: 600;
}

.assignments-print-link,
.assignments-edit-link,
.assignments-open-tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    text-decoration: none;
    border-radius: var(--radius-sm);
    padding: 0.15rem;
}

.assignments-delete-link {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #b84f1c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.assignments-print-link:hover,
.assignments-edit-link:hover,
.assignments-open-tab-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

.assignments-print-icon,
.assignments-edit-icon,
.assignments-open-tab-icon {
    width: 1.35rem;
    height: 1.35rem;
    display: block;
}

.assignments-col-print {
    width: 4.5rem;
    text-align: center;
}

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

.tasks-page-header {
    margin-bottom: 0.25rem;
}

.tasks-page-header-text h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
    font-family: var(--font-display, "Outfit", system-ui, sans-serif);
    letter-spacing: -0.02em;
}

.tasks-page-lead {
    margin: 0;
    font-size: 0.95rem;
}

.tasks-subnav {
    margin: 0.35rem 0 1.1rem;
    max-width: 100%;
}

.technicians-admin-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.technicians-admin-top-shell {
    margin-bottom: 0;
}

.technicians-admin-toolbar .finance-toolbar-title {
    margin-bottom: 0;
}

.technicians-admin-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1rem;
}

.technicians-admin-title {
    flex: 1 1 auto;
    min-width: 0;
}

.technicians-new-dialog {
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    padding: 0;
    max-width: min(32rem, calc(100vw - 2rem));
    width: 100%;
    background: var(--surface-elevated, #fff);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    overflow: visible;
}

.technicians-new-dialog::backdrop {
    background: rgba(15, 23, 42, 0.35);
}

.technicians-new-dialog-form {
    padding: 1.15rem 1.25rem 1.25rem;
}

.technicians-new-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.technicians-new-dialog-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-display, "Outfit", system-ui, sans-serif);
    letter-spacing: -0.02em;
}

.technicians-dialog-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0 0.15rem;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.technicians-dialog-close:hover {
    color: var(--text);
    background: rgba(15, 23, 42, 0.06);
}

.technicians-new-dialog-lead {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    line-height: 1.45;
}

.technicians-dialog-search-field {
    display: block;
    margin-bottom: 0.35rem;
}

.technicians-debug-panel {
    margin: 0 0 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.04);
    padding: 0.5rem 0.6rem;
}

.technicians-debug-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.technicians-debug-body {
    margin: 0;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--text);
    max-height: 10rem;
    overflow: auto;
}

.technicians-dialog-results {
    margin-bottom: 0.85rem;
}

.technicians-picked-banner {
    margin: 0 0 1rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    background: rgba(26, 115, 229, 0.08);
    border: 1px solid rgba(26, 115, 229, 0.2);
    font-size: 0.9rem;
}

.technicians-picked-label {
    font-weight: 600;
    margin-right: 0.35rem;
}

.technicians-new-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    padding-top: 0.25rem;
}

.technicians-new-dialog .assignments-filter-input {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
}

.technicians-new-dialog .assignments-filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(26, 115, 229, 0.15);
}

.technicians-create-shell {
    margin-bottom: 0;
}

.technicians-create-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem 1rem;
    padding: 0 0 0.5rem;
}

.technicians-lookup-block {
    padding: 0 0 0.15rem;
}

.technicians-lookup-field {
    display: block;
}

.technicians-lookup-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: stretch;
}

.technicians-lookup-row .assignments-filter-input {
    flex: 1 1 200px;
    min-width: 0;
}

.tech-lookup-results {
    margin-top: 0.5rem;
    max-height: 220px;
    overflow: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface, #fafafa);
    padding: 0.35rem;
}

.tech-lookup-results:empty {
    display: none;
}

button.tech-lookup-pick {
    display: block;
    width: 100%;
    text-align: left;
    margin: 0 0 0.35rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--surface-elevated, #fff);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

button.tech-lookup-pick:last-child {
    margin-bottom: 0;
}

button.tech-lookup-pick:hover {
    border-color: var(--accent);
    background: rgba(26, 115, 229, 0.06);
}

.b2b-sn-picker-in-dialog {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.b2b-sn-picker-in-dialog[hidden] {
    display: none !important;
}

/* Main-pane overlays: cover dashboard content only; sidebar stays visible and static */
.b2b-overlay-main-pane.b2b-sn-picker-in-dialog {
    left: var(--sidebar-w);
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 180;
}

#dashboard-frame:has(.sidebar--collapsed) .b2b-overlay-main-pane.b2b-sn-picker-in-dialog {
    left: var(--sidebar-collapsed-w);
}

.b2b-sn-picker-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    cursor: pointer;
}

.b2b-sn-picker-in-dialog .b2b-sn-picker-card {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.b2b-sn-picker-card {
    width: min(960px, calc(100vw - 1rem));
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1rem 1.05rem;
    border-radius: var(--radius, 12px);
    border: 1px solid var(--border);
    background: var(--surface-elevated, #fff);
    box-shadow: 0 26px 54px rgba(2, 6, 23, 0.28);
}

.b2b-sn-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.b2b-sn-picker-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text);
}

.b2b-sn-picker-hint {
    margin: 0;
}

.b2b-sn-picker-list {
    max-height: min(52vh, 420px);
    overflow: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface, #fafafa);
    padding: 0;
}

.b2b-sn-picker-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.86rem;
}

.b2b-sn-picker-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.5rem 0.55rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface, #f1f5f9);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.b2b-sn-picker-table .col-mk {
    width: 11%;
}

.b2b-sn-picker-table .col-sn {
    width: 17%;
}

.b2b-sn-picker-table .col-device {
    width: 40%;
}

.b2b-sn-picker-table .col-model {
    width: 17%;
}

.b2b-sn-picker-table .col-date {
    width: 15%;
}

.b2b-sn-picker-table tbody td {
    padding: 0.55rem 0.6rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    background: var(--surface-elevated, #fff);
}

.b2b-sn-picker-table tbody td.col-device {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
    text-overflow: clip;
}

.b2b-sn-picker-table tbody tr.b2b-sn-picker-tr {
    cursor: pointer;
}

.b2b-sn-picker-table tbody tr.b2b-sn-picker-tr:hover td {
    background: rgba(26, 115, 229, 0.08);
}

.b2b-sn-picker-table tbody tr.b2b-sn-picker-tr:focus-visible td {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.b2b-sn-picker-table tbody td.col-mk {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.b2b-sn-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.b2b-device-create-card .b2b-device-create-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.85rem;
    margin-top: 0.5rem;
    max-height: min(52vh, 420px);
    overflow: auto;
    padding-right: 0.15rem;
}

.b2b-device-create-card .b2b-device-create-form .assignments-field-span-2 {
    grid-column: 1 / -1;
}

.technicians-create-actions {
    padding-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.technicians-table-shell {
    margin-top: 0.25rem;
}

.technicians-code {
    font-size: 0.88em;
    background: rgba(15, 23, 42, 0.06);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.tasks-page-panel--edit .tasks-page-header {
    display: none;
}

.assignments-edit-page {
    margin-top: 0.25rem;
}

.assignments-edit-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.assignments-edit-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.assignments-task-portal .assignments-accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    background: var(--surface-elevated, #fff);
    margin-bottom: 0.85rem;
    overflow: hidden;
}

.assignments-task-portal .assignments-accordion-summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(15, 23, 42, 0.03);
    font-family: var(--font-display, "Outfit", system-ui, sans-serif);
}

.assignments-task-portal .assignments-accordion-summary::-webkit-details-marker {
    display: none;
}

.assignments-task-portal .assignments-accordion[open] .assignments-accordion-summary {
    border-bottom: 1px solid var(--border);
}

.assignments-portal-fields {
    padding: 1rem;
}

.assignments-portal-hint {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
}

.assignments-portal-subtitle {
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
}

.assignments-yphr-catalog tbody tr {
    cursor: pointer;
    transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.assignments-yphr-catalog tbody tr:hover td {
    background: rgba(15, 23, 42, 0.03);
}

.assignments-yphr-catalog tbody tr.is-selected td,
.assignments-yphr-catalog tbody tr.is-posted td {
    background: rgba(34, 197, 94, 0.12);
    box-shadow: inset 0 0 0 1px rgba(21, 128, 61, 0.26);
}

.assignments-yphr-catalog tbody tr.is-posted td {
    background: rgba(34, 197, 94, 0.18);
}

.assignments-yphr-catalog tbody tr.is-posted .b2b-spare-order-mk {
    font-weight: 600;
    color: #166534;
}

.assignments-yphr-catalog tbody tr.is-posted .b2b-spare-pick:disabled,
.assignments-yphr-catalog tbody tr.is-posted .b2b-spare-qty:disabled {
    opacity: 0.72;
}

.assignments-yphr-catalog .b2b-yphr-pick {
    width: 18px;
    height: 18px;
    accent-color: #15803d;
    cursor: pointer;
}

.assignments-inline-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.assignments-tool-field {
    flex: 1 1 160px;
    min-width: 0;
    position: relative;
}

.assignments-tool-field-wide {
    flex: 2 1 360px;
}

.assignments-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.assignments-photo-card {
    margin: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--surface, #fafafa);
    position: relative;
}

.assignments-photo-delete {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.65rem;
    height: 1.65rem;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.assignments-photo-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.assignments-photo-card figcaption {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.assignments-upload-section {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

.assignments-upload-section .assignments-portal-subtitle {
    margin-top: 0;
}

.assignments-upload-section .assignments-upload-form {
    margin-top: 0.65rem;
}

.assignments-upload-file-field {
    flex: 1 1 12rem;
    min-width: 0;
    margin-bottom: 0;
}

.assignments-upload-card {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: rgba(26, 115, 229, 0.04);
}

.assignments-upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-top: 0.5rem;
}

#task-upload-camera,
#task-upload-gallery {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.assignments-upload-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid rgba(26, 115, 229, 0.35);
    border-radius: 999px;
    background: rgba(26, 115, 229, 0.08);
    color: #1d4ed8;
    padding: 0.5rem 0.85rem;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.assignments-upload-trigger svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    display: block;
}

.assignments-upload-trigger-secondary {
    border-color: rgba(15, 23, 42, 0.2);
    background: rgba(15, 23, 42, 0.04);
    color: #334155;
}

.assignments-upload-preview {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.55rem;
}

.assignments-upload-thumb {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    min-height: 90px;
}

.assignments-upload-thumb img {
    width: 100%;
    height: 96px;
    object-fit: cover;
    display: block;
}

.assignments-upload-remove {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.assignments-upload-status {
    margin: 0.55rem 0 0;
}

.assignments-portal-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    padding: 0.25rem 0.5rem;
    text-decoration: underline;
}

.btn-lg {
    padding: 0.65rem 1.35rem;
    font-size: 1rem;
}

.assignments-edit-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.assignments-edit-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-display, "Outfit", system-ui, sans-serif);
    letter-spacing: -0.02em;
    color: var(--text);
}

.assignments-edit-meta {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
}

.assignments-edit-back {
    flex-shrink: 0;
}

.assignments-edit-alert {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
}

.assignments-order-success {
    margin-top: 0.8rem;
    border: 1px solid rgba(22, 101, 52, 0.22);
    background: rgba(22, 163, 74, 0.08);
    color: #166534;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.assignments-order-success-text {
    font-weight: 700;
}

.assignments-lookup-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    z-index: 50;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.16);
    max-height: 260px;
    overflow: auto;
    padding: 0.15rem 0;
}

.assignments-lookup-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
}

.assignments-lookup-item:hover,
.assignments-lookup-item:focus-visible {
    background: rgba(37, 99, 235, 0.08);
    outline: none;
}

.assignments-lookup-main {
    display: block;
    font-size: 0.92rem;
    color: var(--text);
}

.assignments-lookup-meta {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.assignments-edit-form {
    display: block;
    max-width: none;
}

.assignments-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 900px) {
    .assignments-edit-grid {
        grid-template-columns: 1fr;
    }
}

.assignments-card {
    background: var(--surface-elevated, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    padding: 1.15rem 1.25rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.assignments-card-wide {
    grid-column: 1 / -1;
}

.assignments-card-title {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-display, "Outfit", system-ui, sans-serif);
}

.assignments-card-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}

@media (max-width: 600px) {
    .assignments-card-fields {
        grid-template-columns: 1fr;
    }
}

.assignments-field-span-2 {
    grid-column: 1 / -1;
}

.assignments-field-block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
}

.assignments-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.assignments-field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}

.assignments-field-static .assignments-static-value {
    margin: 0;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    background: var(--surface-muted, #f1f5f9);
    font-size: 0.92rem;
    color: var(--text);
}

.assignments-field-hint {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
}

.assignments-input,
.assignments-select,
.assignments-textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font: inherit;
    font-size: 0.92rem;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.assignments-input:hover,
.assignments-select:hover,
.assignments-textarea:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.assignments-input:focus,
.assignments-select:focus,
.assignments-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.assignments-input.is-invalid {
    border-color: #da6329;
    box-shadow: 0 0 0 3px rgba(218, 99, 41, 0.16);
}

.assignments-textarea {
    min-height: 5.5rem;
    resize: vertical;
    line-height: 1.45;
}

.assignments-notes-panel {
    margin-top: 1rem;
}

.assignments-notes-panel .assignments-field-label {
    display: block;
    margin-bottom: 0.35rem;
}

.assignments-notes-history {
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--surface-muted, #f8fafc);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    line-height: 1.45;
    max-height: 16rem;
    overflow: auto;
    color: var(--text);
}

.assignments-edit-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--border);
}

.assignments-edit-shell {
    margin-top: 0.5rem;
}

.assignments-edit-toolbar {
    margin-bottom: 1rem;
}

.assignments-edit-readonly,
.assignments-edit-hint {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-elevated, #f3f4f6);
}

.btn-secondary.assignments-btn-new-task {
    background: #6b7280;
    border-color: #4b5563;
    color: #f9fafb;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.2);
}

.btn-secondary.assignments-btn-new-task:hover {
    background: #5f6774;
    border-color: #374151;
    color: #ffffff;
}

.assignments-task-portal .assignments-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
}

.assignments-task-portal .assignments-success-card {
    width: min(520px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.task-appointment-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.56);
}

.task-appointment-overlay-card {
    width: min(480px, 100%);
    max-height: calc(100vh - 2.5rem);
    overflow: auto;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    box-shadow: 0 26px 54px rgba(2, 6, 23, 0.28);
    padding: 1.35rem 1.4rem 1.25rem;
}

.task-appointment-overlay-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.35;
    color: #0f172a;
}

.task-appointment-overlay-message {
    margin: 0.65rem 0 1.15rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #475569;
}

.task-appointment-overlay-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin: 0 0 1.25rem;
}

.task-appointment-overlay-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
}

.task-appointment-overlay-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.62rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 0.95rem;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.task-appointment-overlay-input:hover {
    border-color: #94a3b8;
}

.task-appointment-overlay-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.task-appointment-overlay-input:invalid {
    border-color: #cbd5e1;
    box-shadow: none;
}

.task-appointment-overlay-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

@media (max-width: 520px) {
    .task-appointment-overlay-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .task-appointment-overlay-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.task-appointment-customer-panel[hidden] {
    display: none !important;
}

.task-appointment-customer-list {
    margin: 0 0 1rem;
    display: grid;
    gap: 0.65rem;
}

.task-appointment-customer-list dt {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.task-appointment-customer-list dd {
    margin: 0.15rem 0 0;
    font-size: 1rem;
    color: #111827;
}

.task-appointment-customer-list a {
    color: #b84f1c;
    font-weight: 600;
    text-decoration: none;
}

.task-appointment-customer-list a:hover {
    text-decoration: underline;
}

.task-executed-check-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1650;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.75rem 1rem 0.65rem;
    background: linear-gradient(180deg, #991b1b 0%, #7f1d1d 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(127, 29, 29, 0.35);
}

.task-executed-check-bar[hidden] {
    display: none !important;
}

.task-executed-check-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 1.5rem;
}

.task-executed-check-bar-text {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
}

.task-executed-check-bar-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: task-executed-check-spin 0.75s linear infinite;
    flex: 0 0 auto;
}

.task-executed-check-bar-track {
    width: min(520px, calc(100vw - 2rem));
    margin: 0 auto;
    height: 0.38rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    overflow: hidden;
}

.task-executed-check-bar-progress {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #fecaca 0%, #fff 100%);
    transition: width 0.45s ease;
}

@keyframes task-executed-check-spin {
    to {
        transform: rotate(360deg);
    }
}

.task-validation-overlay-message {
    margin: 0.65rem 0 1.25rem;
    font-size: 0.98rem;
    line-height: 1.65;
    color: #0f172a;
    font-weight: 600;
}

.assignments-status-live-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1600;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: min(360px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    pointer-events: none;
}

.assignments-status-live-toast {
    pointer-events: auto;
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.95rem 1rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(185, 28, 28, 0.35);
    background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
    box-shadow: 0 18px 38px rgba(127, 29, 29, 0.22);
    animation: assignments-status-live-in 0.28s ease-out;
}

.assignments-status-live-toast + .assignments-status-live-toast {
    margin-top: 0;
}

.assignments-status-live-toast.is-leaving {
    animation: assignments-status-live-out 0.22s ease-in forwards;
}

.assignments-status-live-toast-body {
    margin: 0;
    padding-right: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1f2937;
}

.assignments-status-live-toast-body strong {
    color: var(--accent-strong, #b84f1c);
    font-weight: 800;
}

.assignments-status-live-toast-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
}

.assignments-status-live-view {
    min-height: 2.2rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.88rem;
    background: linear-gradient(135deg, var(--accent, #da6329) 0%, var(--accent-strong, #b84f1c) 100%);
    border-color: var(--accent-strong, #b84f1c);
}

.assignments-status-live-view:hover {
    background: linear-gradient(135deg, var(--accent-hover, #e8793a) 0%, var(--accent, #da6329) 100%);
    border-color: var(--accent, #da6329);
    color: #fff;
}

.assignments-status-live-dismiss {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 999px;
    background: rgba(185, 28, 28, 0.08);
    color: var(--accent-strong, #b84f1c);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.assignments-status-live-dismiss:hover {
    background: rgba(185, 28, 28, 0.16);
    color: #991b1b;
}

@keyframes assignments-status-live-in {
    from {
        opacity: 0;
        transform: translateX(1.1rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes assignments-status-live-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(1.1rem);
    }
}

@media (max-width: 640px) {
    .assignments-status-live-stack {
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}

.task-guard-confirm {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.task-guard-confirm[hidden] {
    display: none !important;
}

.task-guard-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.56);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: default;
}

.task-guard-confirm-dialog {
    position: relative;
    width: min(560px, 100%);
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #fff;
    box-shadow: 0 26px 54px rgba(2, 6, 23, 0.28);
    padding: 1rem 1.05rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.task-guard-confirm-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: #0f172a;
}

.task-guard-confirm-message {
    margin: 0.58rem 0 0.86rem;
    color: #475569;
}

.task-guard-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.assignments-edit-status-bar {
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.03);
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
    align-items: flex-start;
    max-width: 860px;
}

.assignments-edit-status-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    flex: 1 1 180px;
    min-width: 160px;
    max-width: 420px;
}

.assignments-edit-status-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.assignments-edit-status-select,
.assignments-edit-status-readonly {
    font-size: 1rem;
    font-weight: 600;
}

.assignments-edit-status-hint {
    margin: 0;
    font-size: 0.82rem;
}

.assignments-edit-status-hint-full {
    flex: 1 1 100%;
}

.assignments-readonly-banner {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(59, 130, 246, 0.08);
    color: #1e3a8a;
    font-weight: 600;
}

/* Fieldset wraps accordions for read-only lock; reset browser default groove border. */
.assignments-portal-editable {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.assignments-task-readonly .assignments-portal-editable:disabled {
    opacity: 1;
}

.assignments-task-readonly .assignments-portal-editable:disabled .assignments-input,
.assignments-task-readonly .assignments-portal-editable:disabled .assignments-select,
.assignments-task-readonly .assignments-portal-editable:disabled .assignments-textarea {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text);
    opacity: 1;
}


/* ——— E-shop catalog ——— */
.shop-layout {
    display: block;
}
.shop-filters {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    position: sticky;
    top: 0.75rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
}
.shop-search-form {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1.1rem;
}
.shop-search-label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}
.shop-search-label input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    font: inherit;
    background: #fff;
}
.shop-filter-block + .shop-filter-block {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.shop-filter-title {
    margin: 0 0 0.55rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
}
.shop-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.2rem;
}
.shop-filter-link {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}
.shop-filter-link em {
    font-style: normal;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.shop-filter-link:hover,
.shop-filter-link.is-active {
    background: var(--accent-dim);
    color: var(--accent-strong);
}
.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 0.65rem;
}
.shop-heading {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.45rem;
}
.shop-meta { margin: 0.2rem 0 0; }
.shop-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    margin-left: 0.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #fff;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
}
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.shop-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shop-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.shop-card-media {
    aspect-ratio: 4 / 3;
    background: #f3f1ee;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.shop-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.shop-card-ph {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.shop-card-body {
    padding: 0.85rem 0.95rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}
.shop-card-brand {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-strong);
    font-weight: 700;
}
.shop-card-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    font-family: var(--font-display);
}
.shop-card-code,
.shop-card-type {
    margin: 0;
    font-size: 0.82rem;
}
.shop-card-foot {
    margin-top: auto;
    padding-top: 0.7rem;
    display: grid;
    gap: 0.55rem;
}
.shop-card-price {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}
.shop-card-price strong {
    font-size: 1.1rem;
    color: var(--text);
}
.shop-card-actions {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0.45rem;
}
.shop-qty,
.shop-cart-qty {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.4rem;
    font: inherit;
    text-align: center;
    background: #fff;
}
.shop-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1.4rem 0 0.5rem;
}
.shop-empty {
    padding: 2rem 1rem;
    text-align: center;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}
.shop-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(400px, 94vw);
    height: 100vh;
    background: #fff;
    z-index: 260;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.22s ease;
    pointer-events: auto;
}
.shop-cart-drawer[hidden] {
    /* Ensure the drawer is fully removed from layout when server sets `hidden`. */
    display: none !important;
}
.shop-cart-drawer.is-open {
    transform: translateX(0);
}
.shop-cart-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 12, 0.35);
    z-index: 250;
}
.shop-cart-backdrop[hidden] {
    display: none !important;
}
.shop-cart-head,
.shop-cart-foot {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.shop-cart-foot {
    border-bottom: 0;
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
}
.shop-cart-head h3 {
    margin: 0;
    font-family: var(--font-display);
}
.shop-cart-close {
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
}
.shop-cart-body {
    flex: 1;
    overflow: auto;
    padding: 0.75rem 1.1rem;
}
.shop-cart-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}
.shop-cart-line {
    display: grid;
    gap: 0.55rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.shop-cart-line-info .shop-row-line {
    margin: 0.15rem 0;
}
.shop-cart-line-info .shop-row-buy,
.shop-cart-line-info .shop-row-discount {
    margin: 0.25rem 0 0;
}
.shop-cart-line strong {
    display: inline;
}
.shop-cart-line-actions {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 0.5rem;
    align-items: center;
}
.shop-cart-line-total {
    font-weight: 600;
    color: #2e7d32;
    text-align: right;
}
.shop-cart-remove {
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--danger);
}
.shop-cart-total {
    font-size: 1.05rem;
}
.shop-cart-totals {
    display: grid;
    gap: 0.28rem;
    margin-bottom: 0.35rem;
}
.shop-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-size: 0.95rem;
}
.shop-cart-total-row.is-grand {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 0.2rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
}
.shop-cart-actions {
    display: grid;
    gap: 0.5rem;
}
.shop-cart-msg.is-error {
    color: var(--danger);
}
.shop-top-cart {
    cursor: pointer;
    border: 0;
    background: var(--accent);
    color: #fff;
}
.shop-top-cart .shop-cart-badge {
    background: #fff;
    color: var(--accent-strong);
}
@media (max-width: 960px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
    .shop-filters {
        position: static;
        max-height: none;
    }
}

/* Horizontal e-shop filters */
.shop-layout-horizontal {
    grid-template-columns: 1fr;
}
.shop-topbar {
    padding: 0 0 0.65rem;
}
.shop-topbar-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.6fr) repeat(3, minmax(140px, 1fr)) auto;
    gap: 0.65rem 0.75rem;
    align-items: end;
}
.shop-top-field {
    display: grid;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}
.shop-top-field input,
.shop-top-field select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.7rem;
    font: inherit;
    background: #fff;
    color: var(--text);
}
.shop-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}
.shop-search-submit {
    min-width: 10.5rem;
    padding-left: 1.35rem;
    padding-right: 1.35rem;
}
.shop-layout .shop-meta {
    margin: 0.4rem 0 0.7rem;
}
.shop-filters { display: none; }
@media (max-width: 1100px) {
    .shop-topbar-form {
        grid-template-columns: 1fr 1fr;
    }
    .shop-top-actions {
        grid-column: 1 / -1;
    }
}
@media (max-width: 640px) {
    .shop-topbar-form {
        grid-template-columns: 1fr;
    }
}

.shop-topbar-form-fast {
    grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
}
.shop-search-only {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
    align-items: end;
    margin-top: 0.85rem;
}
.shop-search-only .shop-top-search {
    flex: 1 1 280px;
}

.shop-admin-pick {
    position: relative;
    margin: 0 0 0.7rem;
    padding: 0.65rem 0.8rem 0.6rem;
    border: 1px solid rgba(218, 99, 41, 0.28);
    border-radius: 10px;
    background: #fff8f4;
    z-index: 4;
}
.shop-admin-pick-field {
    max-width: 42rem;
}
.shop-admin-pick-current {
    margin: 0.45rem 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
}
.shop-admin-pick-clear {
    margin-left: auto;
    padding: 0.28rem 0.7rem;
    font-size: 0.82rem;
}
.shop-admin-pick-list {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% - 0.35rem);
    max-height: 18rem;
    overflow: auto;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    z-index: 8;
}
.shop-admin-pick-list[hidden] {
    display: none;
}
.shop-admin-pick-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    font: inherit;
    color: var(--text);
}
.shop-admin-pick-item:hover,
.shop-admin-pick-item.is-active {
    background: #fff4ec;
}
.shop-admin-pick-item-name {
    display: block;
    font-weight: 700;
}
.shop-admin-pick-item-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.shop-admin-pick-empty {
    padding: 0.65rem 0.85rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.shop-brand-logos {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0;
    width: 100%;
}
.shop-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 78px;
    max-width: none;
    flex: initial;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.shop-brand-logo img {
    max-width: 100%;
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.shop-brand-logo:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.shop-brand-logo.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}
.shop-cat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.95rem;
}
.shop-home-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.85rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-muted);
}
.shop-home-crumb a {
    color: var(--accent-strong);
    text-decoration: none;
}
.shop-home-crumb a:hover {
    text-decoration: underline;
}
.shop-home-crumb-sep {
    color: rgba(15, 23, 42, 0.28);
}
.nav-link-info .nav-label {
    white-space: normal;
    line-height: 1.2;
    font-size: 0.8rem;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.home-eshop {
    display: block;
}
.home-cat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.85rem;
}
.home-cat-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.home-cat-card:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    box-shadow: 0 8px 20px rgba(120, 70, 40, 0.1);
}
.home-cat-card.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.home-cat-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: color-mix(in srgb, var(--accent) 18%, #f4f1ee);
}
.home-cat-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.7rem;
    z-index: 1;
    background: color-mix(in srgb, var(--accent) 18%, #f4f1ee);
}
.home-cat-icon {
    position: absolute;
    z-index: 2;
    width: 2.35rem;
    height: 2.35rem;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: color-mix(in srgb, var(--accent) 58%, #5c4033);
    filter: none;
    pointer-events: none;
}
.home-cat-label {
    display: block;
    padding: 0.7rem 0.65rem 0.8rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.25;
    text-align: center;
    letter-spacing: -0.01em;
    color: #1e293b;
}
@media (max-width: 1180px) {
    .home-cat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 720px) {
    .home-cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }
    .home-cat-label {
        font-size: 0.78rem;
        padding: 0.55rem 0.45rem 0.65rem;
    }
}
.shop-subcat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}
.shop-subcat-btn {
    padding: 0.42rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f8fafc;
}
.shop-cat-btn.is-disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
    background: #f3f4f6 !important;
    color: #64748b !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
}
.shop-cat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.58rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-decoration: none;
    line-height: 1.25;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.shop-cat-btn.is-page {
    border-style: solid;
    border-color: rgba(218, 99, 41, 0.28);
    background: #fff8f4;
}
.shop-cat-btn:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}
.shop-cat-btn.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 8px 16px rgba(218, 99, 41, 0.22);
}
.shop-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.85rem;
}
.shop-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.9fr);
    gap: 1rem 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}
.shop-row.shop-row--admin {
    grid-template-columns: minmax(0, 1.15fr) minmax(210px, 0.85fr) minmax(220px, 0.85fr);
}
.shop-row-admin-prices {
    display: grid;
    gap: 0.32rem;
    align-content: start;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.03);
}
.shop-row-admin-price {
    margin: 0;
    display: grid;
    gap: 0.08rem;
    font-size: 0.82rem;
    line-height: 1.3;
}
.shop-row-admin-price .shop-row-label {
    font-size: 0.76rem;
}
.shop-row-admin-price strong {
    color: var(--text);
    font-size: 0.98rem;
}
.shop-row-admin-price.is-retail strong {
    color: #c62828;
}
.shop-row-info {
    display: grid;
    gap: 0.28rem;
    min-width: 0;
}
.shop-row-line {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--text);
}
.shop-row-label {
    color: var(--text-muted);
    font-weight: 500;
}
.shop-row-sep {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0.55rem 0 0.35rem;
    width: 100%;
    max-width: 14rem;
}
.shop-row-prices {
    display: grid;
    gap: 0.4rem;
    align-content: start;
    justify-items: stretch;
}
.shop-row-avail .shop-avail.is-in {
    color: green;
}
.shop-row-avail .shop-avail.is-out {
    color: red;
}
.shop-row-retail,
.shop-row-buy,
.shop-row-discount {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.35;
}
.shop-row-retail strong {
    color: #c62828;
    font-size: 1.05rem;
}
.shop-row-buy strong {
    color: #2e7d32;
    font-size: 1.05rem;
}
.shop-row-discount strong {
    color: var(--accent);
    font-size: 1.02rem;
}
.shop-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.35rem;
}
.shop-row .shop-qty {
    width: 4.5rem;
}
@media (max-width: 1100px) {
    .shop-topbar-form-fast {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 760px) {
    .shop-row {
        grid-template-columns: 1fr;
    }
    .shop-brand-logos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .shop-brand-logo {
        min-height: 70px;
    }
}

/* Enterprise / Private Network polish */
.login-secure-note {
    margin: 0;
    text-align: center;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: rgba(226, 232, 240, 0.55);
}

.login-foot {
    color: rgba(226, 232, 240, 0.65) !important;
    text-align: center;
}

.login-foot a,
.login-foot a.login-foot-reset {
    color: #fff !important;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.login-foot a:hover,
.login-foot a.login-foot-reset:hover {
    color: var(--accent) !important;
}

.login-powered {
    margin: 0.85rem 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.28rem 0.4rem;
    font-size: 0.72rem;
    line-height: 1.35;
    text-align: center;
    color: rgba(232, 238, 246, 0.62);
}

.login-powered-by {
    width: 100%;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(232, 238, 246, 0.48);
}

.login-powered-link,
.login-powered-link:visited {
    color: #e8eef6;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.login-powered-link:hover,
.login-powered-link:focus-visible {
    color: #fff;
    text-decoration: underline;
}

.login-powered-sep {
    color: rgba(232, 238, 246, 0.35);
    font-weight: 500;
}

.top-bar-kicker {
    margin: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-strong);
    line-height: 1.2;
}

.user-chip-name {
    border-color: rgba(218, 99, 41, 0.28);
    background: linear-gradient(180deg, #fff, #fff8f4);
}

.user-chip.shop-top-cart,
.user-chip-logout {
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.user-chip.shop-top-cart:hover,
.user-chip-logout:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.private-banner {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0.95rem;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid rgba(218, 99, 41, 0.2);
    background:
        linear-gradient(105deg, rgba(218, 99, 41, 0.12), rgba(255, 255, 255, 0.9) 42%, #fff);
    box-shadow: none;
}

.private-banner-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.private-banner-copy strong {
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.private-banner-copy span {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.sidebar-private {
    padding: 0.85rem 0.9rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.sidebar-private-kicker {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #e8eef6;
    margin-bottom: 0.3rem;
}

.sidebar-private-text {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #e8eef6;
    text-align: left;
}

.sidebar--collapsed .sidebar-private-text,
.sidebar--collapsed .sidebar-private-kicker {
    display: none;
}

.sidebar--collapsed .sidebar-private {
    padding: 0.55rem;
    min-height: 12px;
}

.sidebar-powered {
    margin: 0.7rem 0.15rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.28rem 0.4rem;
    font-size: 0.68rem;
    line-height: 1.35;
    text-align: center;
    color: rgba(232, 238, 246, 0.62);
}

.sidebar-powered-by {
    width: 100%;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    color: rgba(232, 238, 246, 0.48);
}

.sidebar-powered-link,
.sidebar-powered-link:visited {
    color: #e8eef6;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.sidebar-powered-link:hover,
.sidebar-powered-link:focus-visible {
    color: #fff;
    text-decoration: underline;
}

.sidebar-powered-sep {
    color: rgba(232, 238, 246, 0.35);
    font-weight: 500;
}

.sidebar--collapsed .sidebar-powered {
    display: none;
}

.main-stage > .panel {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
}

.main-stage > .panel.is-visible {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.main-stage > #panel-shop,
.main-stage > #panel-home {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
    min-height: 0;
    animation: none;
}

.main-stage > #panel-calls.is-visible,
.main-stage > #panel-call-history.is-visible {
    overflow: hidden;
}

.shop-topbar {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 0 0.65rem;
}

.shop-row {
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.shop-row:hover {
    transform: translateY(-2px);
    border-color: rgba(218, 99, 41, 0.28) !important;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.shop-cat-btn {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.12);
}

.shop-cat-btn.is-page {
    background: #fff8f4;
    border-color: rgba(218, 99, 41, 0.28);
}

.shop-cat-btn.is-active {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

.info-page {
    max-width: 46rem;
    padding: 0.15rem 0.1rem 0.4rem;
}
.info-page-links,
.info-page-notes {
    margin: 0;
    padding: 0;
    list-style: none;
}
.info-page-links {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1.35rem;
}
.info-page-links li {
    padding: 0.95rem 1.1rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text);
}
.info-page-links a {
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}
.info-page-links a:hover {
    color: var(--accent);
}
.info-page-notes {
    display: grid;
    gap: 0.7rem;
}
.info-page-notes li {
    position: relative;
    padding: 0.15rem 0 0.15rem 1.15rem;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.55;
}
.info-page-notes li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--accent);
}

.shop-static-page {
    margin: 0.2rem 0 0.75rem;
    padding: 0.85rem 1rem 1rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.shop-static-title {
    margin: 0 0 0.85rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.shop-static-body {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.7;
    overflow-x: auto;
}

.shop-static-body h1,
.shop-static-body h2,
.shop-static-body h3,
.shop-static-body h4 {
    font-family: var(--font-display);
    margin: 1.1rem 0 0.45rem;
    line-height: 1.3;
}

.shop-static-body p {
    margin: 0 0 0.75rem;
}

.shop-static-body ul,
.shop-static-body ol {
    margin: 0 0 0.85rem;
    padding-left: 1.2rem;
}

.shop-static-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.shop-static-body table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1rem;
    font-size: 0.9rem;
}

.shop-static-body th,
.shop-static-body td {
    border: 1px solid var(--border);
    padding: 0.45rem 0.6rem;
    text-align: left;
}

.shop-static-body a {
    color: var(--accent-strong);
    font-weight: 600;
}

.btn-primary {
    box-shadow: 0 8px 18px rgba(218, 99, 41, 0.22);
}

.btn-primary:hover {
    box-shadow: 0 10px 22px rgba(218, 99, 41, 0.28);
}

@media (max-width: 720px) {
    .private-banner-copy span {
        font-size: 0.82rem;
    }
}

.calls-desk {
    padding: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.calls-split {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 0.75rem;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}
@media (max-width: 960px) {
    .calls-split {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .calls-list-card,
    .calls-dossier {
        display: block;
    }
    .calls-list {
        max-height: 50vh;
    }
    .main-stage > #panel-calls.is-visible {
        overflow: auto;
    }
}
.calls-list-card, .calls-dossier {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.7rem 0.7rem;
    box-shadow: none;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.calls-list-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.calls-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex-shrink: 0;
}
.calls-list-head h2, .calls-dossier-head h3 { margin: 0; font-family: var(--font-display); }
.calls-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.28rem;
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: auto;
}
.calls-item {
    flex: 0 0 auto;
}
.calls-item-btn {
    width: 100%;
    text-align: left;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    cursor: pointer;
    display: grid;
    gap: 0.05rem;
}
.calls-item.is-customer .calls-item-btn {
    border-color: rgba(218, 99, 41, 0.28);
}
.calls-item.is-customer .calls-item-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.calls-item.is-selected .calls-item-btn {
    border-color: var(--accent);
    background: #fff8f4;
    box-shadow: 0 0 0 2px var(--accent-dim);
}
.calls-item.is-ringing .calls-item-btn {
    border-color: rgba(218, 99, 41, 0.45);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.calls-item-phone { font-weight: 700; color: var(--text); font-size: 0.9rem; line-height: 1.25; }
.calls-item-name { font-size: 0.82rem; line-height: 1.25; }
.calls-item-meta { font-size: 0.72rem; color: var(--text-muted); line-height: 1.2; }
.calls-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-strong);
}
.calls-d-phone { margin: 0.15rem 0 0.35rem; font-size: 1.15rem; font-weight: 700; }
.calls-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0; }
.calls-sub { margin: 1.1rem 0 0.5rem; font-size: 0.95rem; }
.calls-unknown {
    background: #fff6e8;
    border: 1px solid rgba(194, 120, 3, 0.35);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    color: #8a5a00;
}
.desk-banner {
    display: none;
    flex-shrink: 0;
    margin: 0;
    padding: 0.5rem 0.95rem;
    border-radius: 0;
    background: #fff8f4;
    border: 0;
    border-bottom: 1px solid rgba(218, 99, 41, 0.28);
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: flex-start;
    justify-content: space-between;
}
.desk-banner.is-live {
    display: flex;
}
.desk-banner.is-customer {
    background: #f3f8f4;
    border-color: rgba(34, 140, 74, 0.28);
}
.desk-banner[hidden] {
    display: none !important;
}
.desk-banner-copy {
    min-width: 12rem;
    flex: 1 1 16rem;
}
.desk-banner-balance,
.desk-banner-notes,
.calls-d-balance,
.calls-d-notes {
    margin: 0.35rem 0 0;
    font-size: 0.92rem;
    line-height: 1.35;
}
.desk-banner-balance strong,
.calls-d-balance strong {
    font-weight: 800;
}
.desk-banner-notes,
.calls-d-notes {
    color: #6b4a12;
    white-space: pre-wrap;
}
.desk-banner-actions {
    margin: 0;
}
.phone-conn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.35rem 0 0;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid var(--border);
    background: #f4f6f8;
    color: var(--text-muted);
    line-height: 1.2;
}
.top-actions .phone-conn { margin: 0; }
.phone-conn-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #9aa3ad;
    box-shadow: 0 0 0 3px rgba(154, 163, 173, 0.18);
}
.phone-conn.is-pending .phone-conn-dot {
    background: #d39b00;
    box-shadow: 0 0 0 3px rgba(211, 155, 0, 0.18);
    animation: phone-conn-pulse 1.2s ease-in-out infinite;
}
.phone-conn.is-connected {
    background: #eaf8ef;
    border-color: rgba(34, 140, 74, 0.28);
    color: #1b6b38;
}
.phone-conn.is-connected .phone-conn-dot {
    background: #22a34a;
    box-shadow: 0 0 0 3px rgba(34, 163, 74, 0.18);
}
.phone-conn.is-disconnected {
    background: #fdeeee;
    border-color: rgba(176, 42, 42, 0.25);
    color: #8f1f1f;
}
.phone-conn.is-disconnected .phone-conn-dot {
    background: #d13b3b;
    box-shadow: 0 0 0 3px rgba(209, 59, 59, 0.16);
}
@keyframes phone-conn-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.call-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 120;
    width: min(380px, calc(100vw - 1.5rem));
}
.call-toast-card {
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(218, 99, 41, 0.35);
    animation: loginRise 0.25s ease both;
}
.call-toast-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-strong);
}
.call-toast-title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; }
.call-toast-name { margin: 0.25rem 0 0.85rem; }
.call-toast-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }

.nav-label {
    min-width: 0;
    line-height: 1.25;
}

.account-flash {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.account-flash.is-ok {
    background: #eaf8ef;
    border: 1px solid rgba(34, 140, 74, 0.28);
    color: #1b6b38;
}
.account-flash.is-error {
    background: #fdeeee;
    border: 1px solid rgba(176, 42, 42, 0.25);
    color: #8f1f1f;
}
.account-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: none;
}
.account-fieldset {
    margin: 0;
    padding: 1rem 1.1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
}
.account-fieldset legend {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0 0.35rem;
}
.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}
.account-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.account-field-wide {
    grid-column: 1 / -1;
}
.account-field input {
    font: inherit;
    font-weight: 500;
    color: var(--text);
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
.account-field input:focus {
    outline: 2px solid rgba(218, 99, 41, 0.35);
    border-color: var(--accent);
}
.account-field input[readonly],
.account-field select:disabled {
    background: #f4f6f8;
    color: var(--text-muted);
    cursor: not-allowed;
}
.account-field.is-locked input,
.account-field.is-locked select {
    background: #f4f6f8;
}
.account-lock-hint {
    font-style: normal;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.account-field select {
    font: inherit;
    font-weight: 500;
    color: var(--text);
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
.account-actions {
    display: flex;
    gap: 0.65rem;
}
.goal-pct {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 7rem;
}
.goal-pct-bar {
    display: block;
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
.goal-pct-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    border-radius: inherit;
}
.shop-basket-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.shop-basket-page .shop-cart-body {
    overflow: visible;
    padding: 0;
}
.shop-basket-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
}
.shop-basket-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 860px;
}
.shop-basket-table th,
.shop-basket-table td {
    padding: 0.5rem 0.55rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: left;
}
.shop-basket-table thead th {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    background: #f4f6f8;
    border-bottom: 2px solid var(--border);
}
.shop-basket-table tbody tr:last-child td {
    border-bottom: 0;
}
.shop-basket-table .num {
    text-align: right;
    white-space: nowrap;
}
.shop-basket-table .pr-remove {
    width: 2.2rem;
    text-align: center;
}
.shop-basket-table .pr-code,
.shop-basket-table .pr-new {
    font-weight: 600;
    white-space: nowrap;
}
.shop-basket-table .pr-name {
    min-width: 12rem;
}
.shop-basket-table .pr-qty {
    width: 5.5rem;
}
.shop-basket-table .shop-cart-qty {
    width: 4.4rem;
}
.shop-basket-table tr.shop-cart-line {
    display: table-row;
    padding: 0;
    border: 0;
    gap: 0;
}
.shop-basket-table .pr-total {
    font-weight: 700;
    color: #2e7d32;
}
.shop-basket-checkout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 960px;
}
.shop-basket-checkout .account-grid {
    grid-template-columns: 1fr;
    max-width: 720px;
}
.shop-basket-checkout .account-field {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem 0.85rem;
}
.shop-basket-checkout .account-field-wide {
    grid-column: auto;
}
.shop-basket-checkout .shop-basket-notes-field {
    grid-template-columns: 1fr;
    align-items: stretch;
}
.shop-basket-hint {
    margin: 0 0 0.85rem;
}
.account-field textarea {
    font: inherit;
    font-weight: 500;
    color: var(--text);
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    min-height: 5.5rem;
    resize: vertical;
}
.account-field textarea:focus {
    outline: 2px solid rgba(218, 99, 41, 0.35);
    border-color: var(--accent);
}
.shop-basket-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.shop-basket-foot {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.shop-basket-foot .shop-cart-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
@media (max-width: 720px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
    .account-field-wide {
        grid-column: auto;
    }
    .shop-basket-checkout .account-field {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

body.drawer-open {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .home-cat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-cat-label {
        overflow-wrap: anywhere;
        font-size: 0.8rem;
    }

    .shop-row {
        grid-template-columns: 1fr;
    }

    .shop-row-line,
    .shop-row-retail,
    .shop-row-buy {
        overflow-wrap: anywhere;
    }

    .shop-row-actions {
        width: 100%;
    }

    .shop-row-actions .btn,
    .shop-search-submit {
        min-width: 0;
        flex: 1 1 auto;
    }

    .shop-pager {
        flex-wrap: wrap;
        gap: 0.65rem;
    }

    .shop-pager .btn {
        flex: 1 1 8rem;
        text-align: center;
        justify-content: center;
    }

    .private-banner,
    .desk-banner.is-live {
        flex-direction: column;
        align-items: stretch;
    }

    .desk-banner .calls-actions,
    .calls-actions {
        display: flex;
        flex-wrap: wrap;
    }

    .desk-banner .calls-actions .btn,
    .calls-actions .btn {
        flex: 1 1 10rem;
        justify-content: center;
        text-align: center;
    }

    .calls-list-head {
        flex-wrap: wrap;
        gap: 0.65rem;
        align-items: flex-start;
    }

    .shop-cart-drawer {
        width: min(420px, 100vw);
        height: 100dvh;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .shop-cat-btn,
    .shop-subcat-btn {
        white-space: normal;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .finance-total-bar {
        flex-wrap: wrap;
        gap: 0.35rem 0.85rem;
    }

    .user-chip-name {
        max-width: 14rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    input[type="text"],
    input[type="search"],
    input[type="password"],
    input[type="number"],
    input[type="email"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px;
        max-width: 100%;
    }
}

@media (max-width: 720px) {
    .home-cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-brand-logos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-chip-afm {
        display: none;
    }

    .user-chip-logout span {
        display: none;
    }

    .user-chip-name {
        max-width: 38vw;
    }

    .top-actions .phone-conn-label {
        display: none;
    }

    .shop-search-only {
        flex-direction: column;
        align-items: stretch;
    }

    .shop-search-only .shop-top-search {
        flex: 1 1 auto;
        width: 100%;
    }

    .shop-top-actions {
        width: 100%;
    }

    .shop-top-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .shop-row-actions {
        flex-wrap: nowrap;
    }

    .shop-row .shop-qty {
        width: 4.75rem;
        min-height: 2.6rem;
    }

    .shop-add-btn {
        flex: 1;
        min-height: 2.6rem;
    }

    .shop-basket-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .shop-basket-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
        background: transparent;
    }

    .shop-basket-table thead {
        display: none;
    }

    .shop-basket-table tbody,
    .shop-basket-table tr,
    .shop-basket-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .shop-basket-table tr {
        margin-bottom: 0.75rem;
        padding: 0.7rem 0.75rem;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
    }

    .shop-basket-table td {
        border: 0;
        border-bottom: 1px dashed rgba(30, 30, 40, 0.12);
        padding: 0.4rem 0;
        text-align: left !important;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .shop-basket-table td:last-child {
        border-bottom: 0;
    }

    .shop-basket-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.02em;
        margin-bottom: 0.15rem;
    }

    .shop-basket-table td.pr-remove::before,
    .shop-basket-table td:not([data-label])::before {
        content: none;
    }

    .shop-basket-table td.pr-remove {
        text-align: right !important;
        border-bottom: 1px dashed rgba(30, 30, 40, 0.12);
    }

    .shop-basket-table .pr-qty input {
        min-height: 2.5rem;
        width: 5rem;
    }

    .shop-basket-foot .shop-cart-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .shop-cart-line-actions {
        grid-template-columns: 1fr auto auto;
    }

    .shop-static-body {
        font-size: 0.9rem;
    }

    .shop-static-page {
        padding: 0.85rem 0.9rem 1rem;
    }

    .call-toast-card {
        margin: 0.75rem;
        max-width: calc(100vw - 1.5rem);
    }
}

@media (max-width: 420px) {
    .home-cat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .user-chip.shop-top-cart {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }
}

@media (hover: none) {
    .shop-row:hover {
        transform: none;
    }
    .shop-brand-logo:hover {
        transform: none;
    }
    .shop-cat-btn:hover {
        transform: none;
    }
}

.pwa-install {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 320;
    padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0));
    pointer-events: none;
}
.pwa-install[hidden] {
    display: none !important;
}
.pwa-install-card {
    pointer-events: auto;
    display: grid;
    gap: 0.45rem;
    max-width: 28rem;
    margin: 0 auto;
    padding: 0.95rem 1.05rem 1.05rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.pwa-install-logo {
    display: block;
    width: 100%;
    max-width: 220px;
    height: auto;
    margin: 0 auto 0.15rem;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border);
    object-fit: contain;
}
.pwa-install-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-strong);
}
.pwa-install-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
}
.pwa-install-text {
    margin: 0.35rem 0 0.85rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-muted);
}
.pwa-install-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.pwa-install-actions .btn {
    flex: 1 1 8rem;
    justify-content: center;
}
.pwa-install-chip {
    cursor: pointer;
    border: 1px solid rgba(218, 99, 41, 0.35);
    background: #fff8f4;
}
.pwa-install-chip[hidden] {
    display: none !important;
}
html.is-pwa .pwa-install,
html.is-pwa .pwa-install-chip {
    display: none !important;
}
@media (display-mode: standalone) {
    .pwa-install,
    .pwa-install-chip {
        display: none !important;
    }
}
@media (max-width: 720px) {
    .pwa-install-chip span {
        display: none;
    }
}

.calls-history {
    padding: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.calls-history .panel-lead {
    flex-shrink: 0;
}
.calls-history .finance-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
}
.calls-history-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    margin: 0 0 0.7rem;
    flex-shrink: 0;
}
.calls-history-dates {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.65rem;
}
.calls-history-field {
    display: grid;
    gap: 0.28rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.calls-history-field input[type="date"] {
    width: 10.75rem;
    height: 2.45rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.calls-history-toolbar .calls-history-kinds.segmented {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    margin: 0;
    height: 2.45rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.calls-history-toolbar .calls-history-kinds .seg-btn {
    flex: 0 0 auto;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0 1rem;
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.82rem;
    line-height: 1;
    white-space: nowrap;
}
.calls-history-toolbar .calls-history-kinds .seg-btn:last-child {
    border-right: 0;
}
.calls-history-toolbar .calls-history-kinds .seg-btn.is-active {
    background: var(--accent-dim, #f3e6d8);
    color: var(--text);
}
.calls-history-table td:last-child {
    white-space: nowrap;
    text-align: right;
}
.calls-history-table tr.is-missed td {
    background: rgba(194, 84, 32, 0.08);
}
.calls-type {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
}
.calls-type.is-inbound {
    background: rgba(36, 130, 80, 0.14);
    color: #1b6b40;
}
.calls-type.is-outbound {
    background: rgba(36, 90, 160, 0.14);
    color: #1d4f8c;
}
.calls-type.is-missed {
    background: rgba(194, 84, 32, 0.16);
    color: #9a3d12;
}
.account-form.is-readonly input,
.account-form.is-readonly select {
    pointer-events: none;
    background: rgba(0, 0, 0, 0.03);
}
@media (max-width: 900px) {
    .calls-history-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .calls-history-dates {
        width: 100%;
    }
    .calls-history-field {
        flex: 1 1 0;
    }
    .calls-history-field input[type="date"] {
        width: 100%;
        min-width: 0;
    }
    .calls-history-toolbar .calls-history-kinds.segmented {
        width: 100%;
        height: auto;
        flex-wrap: wrap;
    }
    .calls-history-toolbar .calls-history-kinds .seg-btn {
        flex: 1 1 50%;
        height: 2.45rem;
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }
    .calls-history-table td:last-child {
        text-align: left;
    }
}
