:root {
    --bg: #f4f8fb;
    --surface: #ffffff;
    --surface-soft: #eaf4f7;
    --surface-strong: #d9ebf0;
    --text: #172531;
    --muted: #667887;
    --line: #d7e5ec;
    --primary: #176d82;
    --primary-dark: #0f5262;
    --accent: #31a184;
    --accent-soft: rgba(49, 161, 132, 0.12);
    --warning: #b36b00;
    --danger: #b42318;
    --sidebar-bg: #0f2632;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-text: rgba(255, 255, 255, 0.84);
    --topbar-bg: rgba(255, 255, 255, 0.88);
    --hero-glow: rgba(23, 109, 130, 0.1);
    --focus-ring: rgba(23, 109, 130, 0.22);
    --shadow: 0 18px 45px rgba(23, 37, 49, 0.12);
    --soft-shadow: 0 10px 28px rgba(23, 37, 49, 0.08);
}

:root[data-theme="aurora-light"] {
    --bg: #f4f8fb;
    --surface: #ffffff;
    --surface-soft: #eaf4f7;
    --surface-strong: #d9ebf0;
    --text: #172531;
    --muted: #667887;
    --line: #d7e5ec;
    --primary: #176d82;
    --primary-dark: #0f5262;
    --accent: #31a184;
    --accent-soft: rgba(49, 161, 132, 0.12);
    --sidebar-bg: #0f2632;
    --sidebar-text: rgba(255, 255, 255, 0.84);
    --topbar-bg: rgba(255, 255, 255, 0.88);
    --hero-glow: rgba(23, 109, 130, 0.1);
    --focus-ring: rgba(23, 109, 130, 0.22);
}

:root[data-theme="aurora-dark"] {
    --bg: #0d1820;
    --surface: #132530;
    --surface-soft: #19313d;
    --surface-strong: #214453;
    --text: #edf8fb;
    --muted: #9db4be;
    --line: #284654;
    --primary: #5bbad1;
    --primary-dark: #3598b0;
    --accent: #58d4b0;
    --accent-soft: rgba(88, 212, 176, 0.13);
    --sidebar-bg: #081219;
    --sidebar-text: rgba(237, 248, 251, 0.84);
    --topbar-bg: rgba(19, 37, 48, 0.88);
    --hero-glow: rgba(91, 186, 209, 0.12);
    --focus-ring: rgba(91, 186, 209, 0.24);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

:root[data-theme="sage-light"] {
    --bg: #f5f8f2;
    --surface: #ffffff;
    --surface-soft: #edf4e7;
    --surface-strong: #dce9d2;
    --text: #1c2619;
    --muted: #687762;
    --line: #dbe7d4;
    --primary: #4f7d3a;
    --primary-dark: #375d27;
    --accent: #1d8375;
    --accent-soft: rgba(29, 131, 117, 0.12);
    --sidebar-bg: #162514;
    --sidebar-text: rgba(255, 255, 255, 0.84);
    --topbar-bg: rgba(255, 255, 255, 0.88);
    --hero-glow: rgba(79, 125, 58, 0.1);
    --focus-ring: rgba(79, 125, 58, 0.22);
}

:root[data-theme="sage-dark"] {
    --bg: #11180f;
    --surface: #1b2618;
    --surface-soft: #23321f;
    --surface-strong: #30442a;
    --text: #f0f7ec;
    --muted: #a9b9a1;
    --line: #33462e;
    --primary: #93c572;
    --primary-dark: #6fa64f;
    --accent: #5ec7b5;
    --accent-soft: rgba(94, 199, 181, 0.13);
    --sidebar-bg: #0a1209;
    --sidebar-text: rgba(240, 247, 236, 0.84);
    --topbar-bg: rgba(27, 38, 24, 0.88);
    --hero-glow: rgba(147, 197, 114, 0.12);
    --focus-ring: rgba(147, 197, 114, 0.24);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

:root[data-theme="copper-light"] {
    --bg: #faf7f2;
    --surface: #ffffff;
    --surface-soft: #f4eee5;
    --surface-strong: #eadccc;
    --text: #2c2118;
    --muted: #7d6d5c;
    --line: #e8ddcf;
    --primary: #a45f2b;
    --primary-dark: #7c451d;
    --accent: #4e7f6a;
    --accent-soft: rgba(78, 127, 106, 0.12);
    --sidebar-bg: #2d1c12;
    --sidebar-text: rgba(255, 255, 255, 0.84);
    --topbar-bg: rgba(255, 255, 255, 0.88);
    --hero-glow: rgba(164, 95, 43, 0.1);
    --focus-ring: rgba(164, 95, 43, 0.22);
}

:root[data-theme="copper-dark"] {
    --bg: #1b130d;
    --surface: #281c13;
    --surface-soft: #352518;
    --surface-strong: #4a3423;
    --text: #fbf1e6;
    --muted: #c1aa95;
    --line: #4b3525;
    --primary: #e49a5f;
    --primary-dark: #c77739;
    --accent: #78c4a9;
    --accent-soft: rgba(120, 196, 169, 0.13);
    --sidebar-bg: #120b07;
    --sidebar-text: rgba(251, 241, 230, 0.84);
    --topbar-bg: rgba(40, 28, 19, 0.88);
    --hero-glow: rgba(228, 154, 95, 0.12);
    --focus-ring: rgba(228, 154, 95, 0.24);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
    --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

:root[data-theme="indigo-light"] {
    --bg: #f6f6fb;
    --surface: #ffffff;
    --surface-soft: #eeeff8;
    --surface-strong: #dde0f2;
    --text: #1d1e33;
    --muted: #6e7085;
    --line: #dedff0;
    --primary: #5552a3;
    --primary-dark: #3e3b7d;
    --accent: #1d8a9c;
    --accent-soft: rgba(29, 138, 156, 0.12);
    --sidebar-bg: #171735;
    --sidebar-text: rgba(255, 255, 255, 0.84);
    --topbar-bg: rgba(255, 255, 255, 0.88);
    --hero-glow: rgba(85, 82, 163, 0.1);
    --focus-ring: rgba(85, 82, 163, 0.22);
}

:root[data-theme="indigo-dark"] {
    --bg: #111225;
    --surface: #1b1c34;
    --surface-soft: #242646;
    --surface-strong: #323461;
    --text: #f1f2ff;
    --muted: #adafca;
    --line: #343657;
    --primary: #a5a7ff;
    --primary-dark: #7e80e6;
    --accent: #5ed1e4;
    --accent-soft: rgba(94, 209, 228, 0.13);
    --sidebar-bg: #0a0b18;
    --sidebar-text: rgba(241, 242, 255, 0.84);
    --topbar-bg: rgba(27, 28, 52, 0.88);
    --hero-glow: rgba(165, 167, 255, 0.12);
    --focus-ring: rgba(165, 167, 255, 0.24);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

:root[data-theme="mono-light"] {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-soft: #eef1f4;
    --surface-strong: #dde2e8;
    --text: #161b22;
    --muted: #68707c;
    --line: #d9dee6;
    --primary: #475569;
    --primary-dark: #334155;
    --accent: #0f766e;
    --accent-soft: rgba(15, 118, 110, 0.12);
    --sidebar-bg: #111827;
    --sidebar-text: rgba(255, 255, 255, 0.84);
    --topbar-bg: rgba(255, 255, 255, 0.88);
    --hero-glow: rgba(71, 85, 105, 0.1);
    --focus-ring: rgba(71, 85, 105, 0.22);
}

:root[data-theme="mono-dark"] {
    --bg: #0f1217;
    --surface: #181d24;
    --surface-soft: #222936;
    --surface-strong: #303948;
    --text: #eef2f7;
    --muted: #a8b2c0;
    --line: #303846;
    --primary: #aab4c3;
    --primary-dark: #818d9d;
    --accent: #5bc0b6;
    --accent-soft: rgba(91, 192, 182, 0.13);
    --sidebar-bg: #080b10;
    --sidebar-text: rgba(238, 242, 247, 0.84);
    --sidebar-hover: rgba(255, 255, 255, 0.12);
    --topbar-bg: rgba(24, 29, 36, 0.88);
    --hero-glow: rgba(170, 180, 195, 0.12);
    --focus-ring: rgba(170, 180, 195, 0.24);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

:root[data-theme="edo-light"] {
    --bg: #f7f2e8;
    --surface: #fffdf8;
    --surface-soft: #efe4d2;
    --surface-strong: #dec9a7;
    --text: #25231f;
    --muted: #756d60;
    --line: #dfd0b9;
    --primary: #2f5d62;
    --primary-dark: #203f43;
    --accent: #b94e48;
    --accent-soft: rgba(185, 78, 72, 0.12);
    --sidebar-bg: #1f2930;
    --sidebar-text: rgba(255, 253, 248, 0.86);
    --topbar-bg: rgba(255, 253, 248, 0.9);
    --hero-glow: rgba(185, 78, 72, 0.12);
    --focus-ring: rgba(47, 93, 98, 0.22);
}

:root[data-theme="edo-dark"] {
    --bg: #161719;
    --surface: #22262a;
    --surface-soft: #2d3336;
    --surface-strong: #3c4749;
    --text: #f5efe3;
    --muted: #b9ad9c;
    --line: #3b4244;
    --primary: #80b6b2;
    --primary-dark: #5b9490;
    --accent: #d47768;
    --accent-soft: rgba(212, 119, 104, 0.14);
    --sidebar-bg: #0d1114;
    --sidebar-text: rgba(245, 239, 227, 0.86);
    --topbar-bg: rgba(34, 38, 42, 0.9);
    --hero-glow: rgba(212, 119, 104, 0.12);
    --focus-ring: rgba(128, 182, 178, 0.24);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

:root[data-theme="sakura-light"] {
    --bg: #fbf4f0;
    --surface: #fffdfb;
    --surface-soft: #f5e4df;
    --surface-strong: #e7c8c1;
    --text: #2a2226;
    --muted: #7b6870;
    --line: #ead7d4;
    --primary: #8f5d6a;
    --primary-dark: #6d4350;
    --accent: #4b7f78;
    --accent-soft: rgba(75, 127, 120, 0.12);
    --sidebar-bg: #332631;
    --sidebar-text: rgba(255, 253, 251, 0.86);
    --topbar-bg: rgba(255, 253, 251, 0.9);
    --hero-glow: rgba(143, 93, 106, 0.12);
    --focus-ring: rgba(143, 93, 106, 0.22);
}

:root[data-theme="sakura-dark"] {
    --bg: #1b1519;
    --surface: #2a2027;
    --surface-soft: #382b34;
    --surface-strong: #4a3944;
    --text: #fff2ee;
    --muted: #c3aab2;
    --line: #483840;
    --primary: #e0a0aa;
    --primary-dark: #be7886;
    --accent: #7dc0b7;
    --accent-soft: rgba(125, 192, 183, 0.13);
    --sidebar-bg: #120d11;
    --sidebar-text: rgba(255, 242, 238, 0.86);
    --topbar-bg: rgba(42, 32, 39, 0.9);
    --hero-glow: rgba(224, 160, 170, 0.12);
    --focus-ring: rgba(224, 160, 170, 0.24);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

:root[data-theme="washi-light"] {
    --bg: #f8f6ed;
    --surface: #fffef9;
    --surface-soft: #ebe8d8;
    --surface-strong: #d8d2b7;
    --text: #232720;
    --muted: #6f7567;
    --line: #ddd8c4;
    --primary: #4f6f52;
    --primary-dark: #354d38;
    --accent: #ba7b39;
    --accent-soft: rgba(186, 123, 57, 0.12);
    --sidebar-bg: #263026;
    --sidebar-text: rgba(255, 254, 249, 0.86);
    --topbar-bg: rgba(255, 254, 249, 0.9);
    --hero-glow: rgba(186, 123, 57, 0.12);
    --focus-ring: rgba(79, 111, 82, 0.22);
}

:root[data-theme="washi-dark"] {
    --bg: #141813;
    --surface: #20271f;
    --surface-soft: #2b3429;
    --surface-strong: #3a4637;
    --text: #f7f2df;
    --muted: #b7b19d;
    --line: #3d4639;
    --primary: #9fbd8f;
    --primary-dark: #789a68;
    --accent: #dda15e;
    --accent-soft: rgba(221, 161, 94, 0.14);
    --sidebar-bg: #0d100c;
    --sidebar-text: rgba(247, 242, 223, 0.86);
    --topbar-bg: rgba(32, 39, 31, 0.9);
    --hero-glow: rgba(221, 161, 94, 0.12);
    --focus-ring: rgba(159, 189, 143, 0.24);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, var(--hero-glow), transparent 380px),
        linear-gradient(180deg, color-mix(in srgb, var(--surface) 62%, transparent), transparent 280px),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top right, var(--hero-glow), transparent 360px),
        linear-gradient(135deg, var(--focus-ring), var(--accent-soft)),
        var(--bg);
}

.login-shell {
    width: min(100%, 420px);
}

.login-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 32px;
}

.login-brand-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 8px;
}

.brand-mark {
    width: 100px;
    height: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.brand-mark img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.login-brand-row h1 {
    margin: 0;
    line-height: 1.1;
}

.login-panel h1,
.topbar h1,
.panel h2 {
    margin: 0;
}

.login-panel p,
.topbar p {
    margin: 8px 0 0;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.login-form label {
    font-size: 14px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 16px;
}

.login-form button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    margin-top: 8px;
}

.login-form button:hover {
    background: var(--primary-dark);
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-top: 18px;
    font-size: 14px;
}

.alert-error {
    background: #fff1f0;
    color: var(--danger);
    border: 1px solid #ffd4d0;
}

.alert-success {
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
}

.alert-warning {
    background: color-mix(in srgb, var(--warning) 12%, var(--surface));
    color: var(--warning);
    border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--line));
}

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.sidebar-brand {
    display: grid;
    gap: 4px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand span {
    font-size: 15px;
    font-weight: 700;
}

.sidebar-brand-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand-main img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.sidebar-brand-main strong {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.sidebar-brand small {
    color: rgba(255, 255, 255, 0.68);
}

.sidebar-brand-meta {
    display: grid;
    gap: 4px;
    line-height: 1.2;
    font-size: 12px;
}

.sidebar-brand-meta-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sidebar-info-chip {
    position: relative;
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.sidebar-info-tooltip {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    display: none;
    min-width: 160px;
    max-width: 220px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(11, 18, 24, 0.96);
    color: #fff;
    box-shadow: var(--soft-shadow);
    transform: translateY(-50%);
    white-space: normal;
    z-index: 25;
}

.sidebar-info-chip:hover .sidebar-info-tooltip,
.sidebar-info-chip:focus-visible .sidebar-info-tooltip {
    display: block;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
    margin-top: 24px;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.sidebar-nav a,
.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-icon {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    flex: 0 0 auto;
}

.nav-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logout-link {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-backdrop {
    display: none;
}

.app-main {
    min-width: 0;
}

.topbar {
    min-height: 82px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    padding: 18px 28px;
}

.icon-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.icon-button span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    margin: 4px auto;
}

.user-chip {
    display: grid;
    justify-items: end;
    gap: 2px;
    color: var(--muted);
    font-size: 14px;
}

.user-chip strong {
    color: var(--text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-select-wrap {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 8px 12px;
    box-shadow: var(--soft-shadow);
}

.theme-select-wrap:hover {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
}

.theme-select {
    min-width: 132px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    outline: none;
}

.theme-select option {
    color: #172033;
    background: #fff;
}

.theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background:
        linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.workspace {
    padding: 28px;
}

.workspace-empty {
    min-height: calc(100vh - 82px);
}

.action-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.action-card {
    min-height: 132px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(238, 243, 248, 0.6), rgba(255, 255, 255, 0) 72%),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.action-card:hover {
    border-color: rgba(29, 111, 143, 0.45);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    background:
        linear-gradient(180deg, rgba(29, 111, 143, 0.08), rgba(255, 255, 255, 0) 72%),
        var(--surface);
}

.action-card-icon {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(29, 111, 143, 0.1);
    color: var(--primary);
    flex: 0 0 auto;
}

.action-card-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-card-content {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.action-card strong {
    font-size: 18px;
    line-height: 1.25;
}

.action-card small {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.sap-sync-form {
    display: grid;
    gap: 18px;
    margin-bottom: 16px;
}

.offer-builder-panel .panel-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.offer-form {
    margin-top: 18px;
}

.offer-form-grid {
    align-items: start;
}

.offer-step-panel {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.offer-step-header h3,
.offer-step-header p {
    margin: 0;
}

.offer-step-header p {
    margin-top: 6px;
    color: var(--muted);
}

.offer-step-header-split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.offer-discount-wrap {
    min-width: 180px;
    display: grid;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    justify-items: end;
    text-align: left;
    position: relative;
}

.offer-discount-wrap span {
    width: 120px;
}

.offer-field {
    position: relative;
}

.offer-field-help {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.autocomplete {
    position: relative;
}

.autocomplete-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    z-index: 15;
}

.autocomplete-menu[hidden] {
    display: none;
}

[data-order-ekli-kontine-custom-width-wrap][hidden] {
    display: none !important;
}

.autocomplete-option {
    width: 100%;
    display: grid;
    gap: 4px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    padding: 10px 12px;
    text-align: left;
}

.autocomplete-option strong {
    font-size: 14px;
}

.autocomplete-option span {
    color: var(--muted);
    font-size: 12px;
}

.autocomplete-option:hover,
.autocomplete-option.is-active {
    border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.offer-payment-fieldset {
    margin: 18px 0 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.offer-payment-fieldset legend {
    padding: 0 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.offer-payment-fieldset:disabled {
    opacity: 0.65;
}

.offer-actions {
    margin-top: 18px;
}

[data-order-duz-cut-panel] {
    grid-column: 1 / -1;
}

[data-order-ekli-kontine-panel] {
    grid-column: 1 / -1;
}

[data-order-cm-blok-panel] {
    grid-column: 1 / -1;
}

[data-order-piramit-panel] {
    grid-column: 1 / -1;
}

[data-order-duz-cut-panel] > .form-grid.offer-form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
}

[data-order-ekli-kontine-panel] > .form-grid.offer-form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
}

[data-order-cm-blok-panel] > .form-grid.offer-form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
}

[data-order-piramit-panel] > .form-grid.offer-form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
}

[data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(1),
[data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(2),
[data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(3),
[data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(4),
[data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(5),
[data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(6) {
    grid-column: span 1;
}

[data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(7),
[data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(8) {
    grid-column: span 3;
}

[data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(9) {
    grid-column: span 2;
}

[data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(10) {
    grid-column: span 4;
}

[data-order-duz-cut-panel] > .form-grid.offer-form-grid > .offer-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

[data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(10),
[data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(11) {
    grid-column: span 3;
}

[data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(12) {
    grid-column: span 2;
}

[data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(13) {
    grid-column: span 4;
}

[data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > .offer-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

[data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(1),
[data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(2),
[data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(3),
[data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(4),
[data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(5),
[data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(6) {
    grid-column: span 1;
}

[data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(7),
[data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(8) {
    grid-column: span 3;
}

[data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(9) {
    grid-column: span 2;
}

[data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(10) {
    grid-column: span 4;
}

[data-order-cm-blok-panel] > .form-grid.offer-form-grid > .offer-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(1),
[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(2),
[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(3),
[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(4),
[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(5),
[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(6),
[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(7),
[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(8) {
    grid-column: span 1;
}

[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(9),
[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(10) {
    grid-column: span 2;
}

[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(11) {
    grid-column: span 2;
}

[data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(12) {
    grid-column: span 4;
}

[data-order-piramit-panel] > .form-grid.offer-form-grid > .offer-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.offer-price-results {
    margin-top: 22px;
}

.offer-selected-results {
    margin-top: 24px;
}

.offer-save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.order-items {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.order-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-soft) 50%, var(--surface));
}

.order-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.order-item-header strong {
    color: var(--text);
}

.offer-approval-warning {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 12;
    width: min(320px, calc(100vw - 32px));
}

.offer-discount-cell {
    position: relative;
    min-width: 138px;
}

.offer-discount-cell .offer-approval-warning {
    top: calc(100% + 8px);
    right: 0;
    width: min(280px, calc(100vw - 48px));
}

.offer-approval-bubble {
    position: relative;
    border: 1px solid color-mix(in srgb, var(--warning) 55%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--warning) 10%, var(--surface));
    box-shadow: var(--soft-shadow);
    padding: 14px 40px 14px 14px;
}

.offer-approval-bubble::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 18px;
    width: 14px;
    height: 14px;
    border-top: 1px solid color-mix(in srgb, var(--warning) 55%, var(--line));
    border-left: 1px solid color-mix(in srgb, var(--warning) 55%, var(--line));
    background: color-mix(in srgb, var(--warning) 10%, var(--surface));
    transform: rotate(45deg);
}

.offer-approval-bubble p {
    margin: 0;
    color: var(--warning);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.offer-approval-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--warning);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.offer-approval-close:hover {
    background: color-mix(in srgb, var(--warning) 12%, transparent);
}

.offer-price-table th,
.offer-price-table td {
    text-align: center;
}

.offer-price-table thead th {
    vertical-align: middle;
}

.offer-price-table thead tr:first-child th {
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.offer-price-table thead tr:last-child th {
    background: color-mix(in srgb, var(--surface-soft) 82%, var(--surface));
}

.offer-price-table th:first-child,
.offer-price-table td:first-child {
    text-align: left;
}

.offer-discount-input {
    width: 120px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    appearance: textfield;
    -moz-appearance: textfield;
}

.offer-discount-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
    outline: none;
}

.offer-action-cell {
    white-space: nowrap;
}

.offer-remove-line-button {
    min-width: 72px;
}

.offer-discount-input::-webkit-outer-spin-button,
.offer-discount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.form-grid label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.form-grid input,
.form-grid select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
}

.user-form {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-grid label {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
}

.checkbox-grid input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.form-grid input:focus,
.form-grid select:focus,
.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
    outline: none;
}

.primary-button {
    width: fit-content;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    padding: 10px 16px;
    box-shadow: 0 10px 22px var(--focus-ring);
}

.primary-button:hover {
    background: var(--primary-dark);
}

.inline-action-form {
    margin: 0;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
    white-space: nowrap;
}

.secondary-button:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.secondary-button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--surface);
}

.secondary-button.is-active:hover {
    border-color: color-mix(in srgb, var(--surface) 18%, var(--primary));
    background: color-mix(in srgb, var(--surface) 10%, var(--primary));
}

.sync-result {
    display: grid;
    gap: 10px;
}

.sync-result h2,
.sync-result p {
    margin: 0;
}

.sync-result.is-success {
    border-color: rgba(47, 143, 91, 0.35);
}

.sync-result.is-error {
    border-color: rgba(180, 35, 24, 0.35);
}

.sync-table-wrap {
    overflow-x: auto;
}

.sync-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.sync-table th,
.sync-table td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    white-space: nowrap;
}

.sync-table th {
    color: var(--muted);
    font-size: 13px;
}

.portfolio-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.portfolio-toolbar h2,
.portfolio-toolbar p {
    margin: 0;
}

.portfolio-toolbar p {
    margin-top: 6px;
    color: var(--muted);
}

.portfolio-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.portfolio-actions form {
    margin: 0;
}

.data-table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    white-space: nowrap;
}

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

.order-lines-table th,
.order-lines-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.order-lines-table th:nth-child(2),
.order-lines-table td:nth-child(2),
.order-lines-table th:nth-child(5),
.order-lines-table td:nth-child(5),
.order-lines-table th:nth-child(6),
.order-lines-table td:nth-child(6) {
    max-width: 140px;
}

.data-table tbody tr:hover:not(.empty-row) {
    background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.data-table th {
    color: var(--muted);
    font-size: 13px;
}

.interactive-table {
    display: grid;
    gap: 12px;
}

.table-tools {
    display: flex;
    justify-content: flex-end;
    align-items: end;
    gap: 12px;
}

.table-search-field {
    display: grid;
    gap: 6px;
    min-width: min(100%, 320px);
}

.table-search-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.table-search-field input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    box-shadow: var(--soft-shadow);
    -webkit-appearance: none;
    appearance: none;
}

.table-search-field input::placeholder {
    color: var(--muted);
}

.table-search-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.sort-button::after {
    content: "↕";
    color: var(--muted);
    font-size: 12px;
}

.sort-button.is-asc::after {
    content: "↑";
    color: var(--primary);
}

.sort-button.is-desc::after {
    content: "↓";
    color: var(--primary);
}

.empty-row td {
    color: var(--muted);
    text-align: center;
    padding: 34px 10px;
}

.detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.detail-toolbar h2,
.detail-toolbar p {
    margin: 0;
}

.detail-toolbar p {
    margin-top: 6px;
    color: var(--muted);
}

.tabs {
    margin-top: 16px;
}

.tab-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.tab-button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
    white-space: nowrap;
}

.tab-button.is-active {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    color: var(--primary);
}

.tab-panel {
    display: none;
    padding-top: 16px;
}

.tab-panel.is-active {
    display: block;
}

.offer-detail-panel {
    margin-top: 16px;
}

.offer-detail-note {
    margin: 6px 0 0;
    color: var(--muted);
}

.offer-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.offer-detail-actions .primary-button,
.offer-detail-actions .secondary-button {
    min-width: 140px;
    text-align: center;
}

.detail-field-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-field-table th,
.detail-field-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

.detail-field-table th {
    width: 280px;
    color: var(--muted);
    font-size: 13px;
}

.detail-data-table {
    min-width: 920px;
}

.user-list-panel {
    margin-top: 16px;
}

.user-table {
    min-width: 1320px;
}

.material-data-table {
    min-width: 1180px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.profile-form-grid {
    grid-template-columns: 1fr;
}

.profile-meta-panel {
    margin-top: 16px;
}

.profile-summary-table {
    margin-top: 16px;
}

.profile-permissions-panel {
    margin-top: 16px;
}

.permission-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.permission-profile-card {
    display: grid;
    gap: 14px;
    align-content: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-soft) 45%, var(--surface));
    padding: 16px;
}

.permission-profile-card h3,
.permission-profile-card p {
    margin: 0;
}

.permission-profile-card p {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.45;
}

.permission-status-badge {
    width: fit-content;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 700;
}

.permission-status-badge.is-granted {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    color: var(--accent);
}

.permission-status-badge.is-denied {
    border-color: #ffd4d0;
    background: #fff1f0;
    color: var(--danger);
}

.permission-status-badge.is-unknown {
    border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
    background: color-mix(in srgb, var(--warning) 10%, var(--surface));
    color: var(--warning);
}

.permission-meta-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.permission-meta-list div {
    display: grid;
    gap: 3px;
}

.permission-meta-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.permission-meta-list dd {
    margin: 0;
    word-break: break-word;
}

.permission-browser-note {
    margin: 16px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.permission-profile-feedback {
    margin-top: 16px;
}

.permission-modal-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 28, 36, 0.52);
    z-index: 100;
}

.permission-modal {
    width: min(100%, 560px);
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    padding: 22px;
}

.permission-modal h2,
.permission-modal p {
    margin: 0;
}

.permission-modal p {
    color: var(--muted);
    line-height: 1.5;
}

.permission-modal-message {
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    padding: 10px 12px;
}

.permission-modal-message.is-error {
    border-color: #ffd4d0;
    background: #fff1f0;
    color: var(--danger);
}

.permission-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.empty-state {
    color: var(--muted);
    padding: 28px 10px;
    text-align: center;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-grid-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
}

.stat-card {
    padding: 18px;
    display: grid;
    gap: 8px;
}

.stat-card span,
.stat-card small {
    color: var(--muted);
}

.stat-card strong {
    font-size: 28px;
}

.stat-card small {
    color: var(--accent);
    font-weight: 700;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 16px;
    margin-top: 16px;
}

.panel {
    padding: 18px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.panel-header h2 {
    font-size: 18px;
}

.panel-header a {
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
}

.task-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.task-item div {
    display: grid;
    gap: 4px;
}

.task-item span {
    color: var(--muted);
    font-size: 14px;
}

.task-item em {
    align-self: start;
    color: var(--warning);
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.decision-list {
    margin: 16px 0 0;
    padding-left: 20px;
    display: grid;
    gap: 12px;
    color: var(--muted);
}

.report-workspace {
    gap: 16px;
}

.report-filter-panel {
    display: grid;
    gap: 16px;
}

.report-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.report-filter-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.report-filter-form input,
.report-filter-form select {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 11px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
}

.report-filter-form input:focus,
.report-filter-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.report-filter-actions {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.report-tabs {
    margin-top: 0;
}

.report-tab-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.report-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 16px;
}

.report-stat-card {
    position: relative;
    align-content: start;
    min-height: 132px;
}

.report-stat-card.is-success {
    border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
}

.report-stat-card.is-warning {
    border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
    background: color-mix(in srgb, var(--warning) 6%, var(--surface));
}

.report-stat-card.is-danger {
    border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
    background: color-mix(in srgb, var(--danger) 5%, var(--surface));
}

.report-stat-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.report-stat-heading span {
    min-width: 0;
    line-height: 1.35;
}

.report-stat-card strong {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    color: var(--text);
    font-size: 26px;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.report-stat-card strong em {
    color: var(--muted);
    font-size: 15px;
    font-style: normal;
    font-weight: 800;
}

.report-stat-card small {
    line-height: 1.35;
}

.report-stat-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.report-info-button {
    position: relative;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
    color: var(--muted);
    cursor: help;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.report-info-button:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.report-info-tooltip {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    display: none;
    width: min(300px, 72vw);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(11, 18, 24, 0.96);
    box-shadow: var(--soft-shadow);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    padding: 9px 10px;
    text-align: left;
}

.report-info-button:hover .report-info-tooltip,
.report-info-button:focus-visible .report-info-tooltip {
    display: block;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.report-chart-panel,
.report-table-panel {
    min-width: 0;
}

.report-chart-wrap {
    position: relative;
    min-height: 280px;
}

.report-chart-wrap canvas {
    width: 100%;
    height: 280px;
}

.report-chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    color: var(--muted);
    text-align: center;
}

.report-chart-empty[hidden] {
    display: none;
}

.report-table-panel {
    margin-top: 16px;
}

.report-data-table {
    min-width: 860px;
}

.report-map {
    width: 100%;
    min-height: 280px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-soft);
}

.visits-workspace {
    display: grid;
    gap: 18px;
}

.visits-filter-form,
.visit-edit-form {
    display: grid;
    gap: 14px;
}

.visits-filter-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.visits-filter-form label,
.visit-edit-form label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.visits-filter-form input,
.visits-filter-form select,
.visit-edit-form input,
.visit-edit-form textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
}

.visit-edit-form textarea {
    min-height: 120px;
    resize: vertical;
}

.visits-filter-form input:focus,
.visits-filter-form select:focus,
.visit-edit-form input:focus,
.visit-edit-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
    outline: none;
}

.visits-filter-actions {
    display: flex;
    align-items: end;
    gap: 10px;
}

.visits-map {
    position: relative;
    z-index: 0;
    width: 100%;
    min-height: 360px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-soft);
}

.visits-workspace .leaflet-pane {
    z-index: 1;
}

.visits-workspace .leaflet-control-container {
    position: relative;
    z-index: 2;
}

.visits-data-table {
    min-width: 1180px;
}

.visits-data-table tbody tr[data-visit-row] {
    cursor: pointer;
}

.visits-data-table tbody tr[data-visit-row].is-selected td {
    background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}

.visits-action-cell {
    white-space: nowrap;
}

.visit-edit-modal-backdrop[hidden] {
    display: none;
}

.visit-edit-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 28, 36, 0.52);
}

.visit-edit-modal {
    position: relative;
    z-index: 1;
    width: min(100%, 760px);
    max-height: min(90vh, 760px);
    display: grid;
    gap: 16px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    padding: 22px;
}

.visit-edit-modal-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.visit-edit-modal-header h2,
.visit-edit-modal-header p {
    margin: 0;
}

.visit-edit-modal-header p {
    color: var(--muted);
    line-height: 1.45;
}

.visit-modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
}

.visit-modal-close:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
    color: var(--primary);
}

.visit-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visit-edit-description,
.visit-edit-feedback,
.visit-edit-actions {
    grid-column: 1 / -1;
}

.visit-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.customer-visit-panel {
    margin-top: 24px;
}

.customer-visit-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 20px;
    margin-top: 18px;
}

.customer-visit-form {
    display: grid;
    align-content: start;
    gap: 10px;
}

.customer-visit-form label {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.customer-visit-form select,
.customer-visit-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.customer-visit-form select {
    min-height: 42px;
    padding: 0 12px;
}

.customer-visit-form textarea {
    min-height: 112px;
    padding: 12px;
    resize: vertical;
}

.customer-visit-form select:focus,
.customer-visit-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
    outline: none;
}

.customer-visit-feedback {
    margin-top: 4px;
}

.customer-visit-map-wrap {
    min-width: 0;
}

.customer-visit-map {
    width: 100%;
    min-height: 420px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 88%, var(--line));
}

.customer-visit-map-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.customer-visit-tooltip {
    display: grid;
    gap: 3px;
    max-width: 260px;
    color: #172033;
    font-size: 12px;
    line-height: 1.35;
}

.customer-visit-tooltip strong {
    font-size: 13px;
}

.customer-visit-tooltip span,
.customer-visit-tooltip p {
    margin: 0;
}

.customer-visit-tooltip .visit-popup-edit-button {
    width: 100%;
    min-height: 32px;
    margin-top: 6px;
    padding: 6px 10px;
}

@media (max-width: 1024px) {
    .stat-grid,
    .report-grid,
    .report-filter-form,
    .visits-filter-form,
    .content-grid,
    .action-card-grid,
    .form-grid,
    .profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    [data-order-duz-cut-panel] > .form-grid.offer-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    [data-order-cm-blok-panel] > .form-grid.offer-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    [data-order-piramit-panel] > .form-grid.offer-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(7),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(8),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(9),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(10) {
        grid-column: span 2;
    }

    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(10),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(11),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(12),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(13) {
        grid-column: span 2;
    }

    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(7),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(8),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(9),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(10) {
        grid-column: span 2;
    }

    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(9),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(10),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(11),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(12) {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(82vw, 300px);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

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

    .sidebar-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(16, 33, 43, 0.45);
        z-index: 10;
    }

    .topbar {
        align-items: flex-start;
        padding: 16px;
    }

    .icon-button {
        display: block;
        flex: 0 0 auto;
    }

    .user-chip {
        display: none;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .theme-select-wrap {
        max-width: 48px;
        overflow: hidden;
        padding: 8px 10px;
    }

    .theme-select {
        width: 18px;
        min-width: 18px;
        color: transparent;
    }

    .workspace {
        padding: 16px;
    }

    .customer-visit-layout {
        grid-template-columns: 1fr;
    }

    .customer-visit-map {
        min-height: 340px;
    }

    .stat-grid,
    .report-grid,
    .report-filter-form,
    .visits-filter-form,
    .visit-edit-form,
    .content-grid,
    .action-card-grid,
    .form-grid,
    .profile-grid,
    .permission-profile-grid {
        grid-template-columns: 1fr;
    }

    [data-order-duz-cut-panel] > .form-grid.offer-form-grid {
        grid-template-columns: 1fr;
    }

    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid {
        grid-template-columns: 1fr;
    }

    [data-order-cm-blok-panel] > .form-grid.offer-form-grid {
        grid-template-columns: 1fr;
    }

    [data-order-piramit-panel] > .form-grid.offer-form-grid {
        grid-template-columns: 1fr;
    }

    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(1),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(2),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(3),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(4),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(5),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(6),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(7),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(8),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(9),
    [data-order-duz-cut-panel] > .form-grid.offer-form-grid > label:nth-child(10) {
        grid-column: span 1;
    }

    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(1),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(2),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(3),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(4),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(5),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(6),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(7),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(8),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(9),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(10),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(11),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(12),
    [data-order-ekli-kontine-panel] > .form-grid.offer-form-grid > label:nth-child(13) {
        grid-column: span 1;
    }

    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(1),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(2),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(3),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(4),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(5),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(6),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(7),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(8),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(9),
    [data-order-cm-blok-panel] > .form-grid.offer-form-grid > label:nth-child(10) {
        grid-column: span 1;
    }

    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(1),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(2),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(3),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(4),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(5),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(6),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(7),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(8),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(9),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(10),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(11),
    [data-order-piramit-panel] > .form-grid.offer-form-grid > label:nth-child(12) {
        grid-column: span 1;
    }

    .task-item {
        flex-direction: column;
    }

    .offer-step-header-split {
        align-items: stretch;
        flex-direction: column;
    }

    .offer-discount-wrap {
        min-width: 0;
        justify-items: start;
        text-align: left;
    }

    .login-brand-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .offer-approval-warning {
        left: 0;
        right: auto;
        width: min(100%, 320px);
    }

    .offer-approval-bubble::before {
        left: 18px;
        right: auto;
    }

    .offer-discount-wrap span,
    .offer-discount-input {
        width: 100%;
    }

    .portfolio-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .portfolio-toolbar .primary-button,
    .portfolio-actions .secondary-button {
        width: 100%;
        text-align: center;
    }

    .portfolio-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .permission-modal {
        padding: 18px;
    }

    .visit-edit-modal {
        padding: 18px;
    }

    .visit-edit-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .visit-edit-actions .primary-button,
    .visit-edit-actions .secondary-button {
        width: 100%;
    }

    .permission-modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .permission-modal-actions .primary-button,
    .permission-modal-actions .secondary-button,
    .permission-profile-card .secondary-button {
        width: 100%;
    }

    .detail-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .detail-toolbar .secondary-button {
        width: 100%;
    }

    .detail-field-table th,
    .detail-field-table td {
        display: block;
        width: 100%;
    }

    .detail-field-table th {
        border-bottom: 0;
        padding-bottom: 4px;
    }

    .detail-field-table td {
        padding-top: 0;
    }
}

@media (max-width: 420px) {
    .login-panel {
        padding: 24px;
    }

    .topbar h1 {
        font-size: 24px;
    }
}
