:root {
    --ed-red: #ff3608;
    --ed-plum: #561052;
    --ed-blue: #b6eaf4;
    --ed-pink: #f7c9ef;
    --ed-cream: #fffde8;
    --ed-yellow: #ffc400;
    --ed-ink: #231f20;
    --ed-white: #ffffff;
    --ed-line: rgba(86, 16, 82, 0.16);
    --ed-shadow: 0 24px 70px rgba(48, 15, 45, 0.24);
}

/* Login: the product photograph is the single strong visual gesture. */
body#loginBody {
    background: var(--ed-blue);
    color: var(--ed-ink);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-align: left;
}

body#loginBody #brickwall,
body#loginBody #background {
    background-color: var(--ed-blue);
    background-image:
        linear-gradient(90deg, rgba(182, 234, 244, 0.03) 24%, rgba(182, 234, 244, 0.48) 62%, rgba(182, 234, 244, 0.94) 100%),
        url("/branding/assets/edred-login-background.jpg");
    background-position: 48% 53%;
    background-size: cover;
}

body#loginBody #blur {
    display: none;
}

body#loginBody #loginBox {
    top: 50%;
    right: clamp(28px, 5vw, 84px);
    left: auto;
    width: min(448px, calc(100vw - 56px));
    margin: 0;
    padding: 34px 42px;
    transform: translateY(-50%);
    border: 2px solid var(--ed-plum);
    border-radius: 24px;
    box-shadow: var(--ed-shadow);
    isolation: isolate;
}

body#loginBody #loginBox::after {
    border: 0;
    border-radius: 21px;
    background: rgba(255, 253, 232, 0.97);
    box-shadow: none;
}

body#loginBody #logo {
    position: static;
    width: 190px;
    height: 68px;
    margin: 0 auto 14px;
}

body#loginBody #logo a {
    width: 100%;
    height: 100%;
    background: url("/branding/assets/edred-logo-red.png") center / contain no-repeat;
}

body#loginBody #logo img,
body#loginBody #logo .valign-helper {
    opacity: 0;
}

body#loginBody #loginBox .banner {
    margin: 0 0 26px;
    padding: 0;
    border: 0;
    color: #594155;
    background: transparent;
    font-size: 16px;
    line-height: 1.45;
}

body#loginBody #loginBox .banner::before {
    display: block;
    margin-bottom: 12px;
    color: var(--ed-plum);
    content: "Dzień dobry!";
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

body#loginBody #loginBox .banner::after {
    display: block;
    margin-top: 12px;
    color: #594155;
    content: "Zaloguj się, aby przejść do zgłoszeń klientów Ed\00a0 Red.";
}

body#loginBody #login-message {
    position: static;
    margin: 0 0 14px;
    color: #b42318;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

body#loginBody #login-message:empty {
    display: none;
}

body#loginBody form {
    width: 100%;
    margin: 0;
}

body#loginBody fieldset {
    margin: 0;
}

body#loginBody fieldset input {
    width: 100%;
    height: 52px;
    margin: 0 0 16px;
    padding: 0 15px;
    border: 1.5px solid rgba(86, 16, 82, 0.38);
    border-radius: 10px;
    color: var(--ed-ink);
    background: var(--ed-white);
    font-size: 16px;
    font-style: normal;
}

body#loginBody fieldset input::placeholder {
    color: #746273;
    font-style: normal;
}

body#loginBody #reset-link {
    margin: 0 0 16px;
    color: var(--ed-plum);
    font-size: 13px;
    font-weight: 700;
}

body#loginBody button[type="submit"] {
    float: none;
    width: 100%;
    min-height: 52px;
    margin-top: 6px;
    border: 2px solid var(--ed-red);
    border-radius: 10px;
    box-shadow: none;
    color: var(--ed-white);
    background: var(--ed-red);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    transition: transform 140ms ease, background-color 140ms ease;
}

body#loginBody button[type="submit"]:hover {
    transform: translateY(-1px);
    border-color: #e82e05;
    background: #e82e05;
}

body#loginBody #company,
body#loginBody #poweredBy {
    display: none;
}

body#loginBody #loading {
    border: 2px solid var(--ed-plum);
    border-radius: 14px;
    color: var(--ed-plum);
    background: var(--ed-cream);
}

/* Staff panel: calm work surface, with brand concentrated in navigation and actions. */
body:not(#loginBody) {
    color: var(--ed-ink);
    background: var(--ed-cream);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body:not(#loginBody) a,
body:not(#loginBody) .link {
    color: var(--ed-plum);
}

body:not(#loginBody) #container {
    width: calc(100% - 36px);
    max-width: 1180px;
    margin: 18px auto 24px;
    overflow: visible;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(86, 16, 82, 0.10);
}

body:not(#loginBody) #header {
    height: 84px;
    border: 1px solid var(--ed-line);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: var(--ed-pink);
    box-shadow: none;
}

body:not(#loginBody) #header #logo {
    width: 180px;
    height: 72px;
    margin-left: 16px;
    padding: 6px 0;
    background: url("/branding/assets/edred-logo-red.png") left center / 148px auto no-repeat;
}

body:not(#loginBody) #header #logo img,
body:not(#loginBody) #header #logo .valign-helper {
    display: none;
}

body:not(#loginBody) #header #info,
body:not(#loginBody) #header p {
    max-width: 720px;
    margin: 17px 18px 0 0;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    color: var(--ed-plum);
    background: rgba(255, 253, 232, 0.72);
    font-size: 13px;
    font-weight: 650;
}

body:not(#loginBody) #header a {
    color: var(--ed-plum);
}

body:not(#loginBody) #nav {
    height: 42px;
    padding: 8px 22px 0;
    border: 1px solid var(--ed-line);
    border-top: 0;
    border-bottom: 0;
    background: var(--ed-pink);
}

body:not(#loginBody) #nav > li + li {
    margin-left: 4px;
}

body:not(#loginBody) #nav .active,
body:not(#loginBody) #nav .inactive {
    height: 34px;
    min-width: 100px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px 9px 0 0;
    box-shadow: none;
    color: var(--ed-plum);
    line-height: 34px;
}

body:not(#loginBody) #nav .active,
body:not(#loginBody) #nav .inactive:hover {
    background: var(--ed-blue);
}

body:not(#loginBody) #nav .active a {
    color: var(--ed-plum);
}

body:not(#loginBody) #nav .inactive a {
    color: var(--ed-plum);
    font-weight: 700;
}

body:not(#loginBody) #sub_nav {
    min-height: 38px;
    height: auto;
    padding: 6px 22px;
    border: 0;
    color: var(--ed-white);
    background: var(--ed-plum);
    line-height: 26px;
}

body:not(#loginBody) #sub_nav a {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 700;
}

body:not(#loginBody) #sub_nav li.active a,
body:not(#loginBody) #sub_nav a:hover {
    color: var(--ed-blue);
}

body:not(#loginBody) #content {
    min-height: 560px;
    padding: 30px 30px 42px;
    border: 1px solid var(--ed-line);
    border-top: 0;
    border-radius: 0 0 16px 16px;
    background: rgba(255, 255, 255, 0.92);
}

body:not(#loginBody) h1,
body:not(#loginBody) h2,
body:not(#loginBody) h3,
body:not(#loginBody) .headline {
    color: var(--ed-plum);
}

body:not(#loginBody) h2 {
    letter-spacing: -0.025em;
}

body:not(#loginBody) input[type="submit"],
body:not(#loginBody) input[type="button"],
body:not(#loginBody) button[type="submit"],
body:not(#loginBody) .primary.button,
body:not(#loginBody) .action-button {
    border: 1px solid var(--ed-red);
    border-radius: 7px;
    box-shadow: none;
    color: var(--ed-white);
    background: var(--ed-red);
    font-weight: 750;
}

body:not(#loginBody) input[type="submit"]:hover,
body:not(#loginBody) input[type="button"]:hover,
body:not(#loginBody) button[type="submit"]:hover,
body:not(#loginBody) .primary.button:hover,
body:not(#loginBody) .action-button:hover {
    border-color: #e82e05;
    color: var(--ed-white);
    background: #e82e05;
}

body:not(#loginBody) table.list,
body:not(#loginBody) table.dashboard-stats,
body:not(#loginBody) .ticket_info,
body:not(#loginBody) .thread-entry {
    border-color: var(--ed-line);
    border-radius: 10px;
}

body:not(#loginBody) table.list thead th,
body:not(#loginBody) table.list th,
body:not(#loginBody) table.dashboard-stats th {
    border-color: rgba(86, 16, 82, 0.12);
    color: var(--ed-plum);
    background: var(--ed-blue);
    font-weight: 800;
}

body:not(#loginBody) table.list tbody tr:hover td,
body:not(#loginBody) table.list tbody tr:hover th {
    background: #fff6fb;
}

body:not(#loginBody) #breadcrumbs {
    border-radius: 8px;
    color: var(--ed-plum);
    background: rgba(182, 234, 244, 0.55);
}

body:not(#loginBody) #msg_notice,
body:not(#loginBody) .success-banner,
body:not(#loginBody) .notice-banner {
    border-color: #6e9c23;
    background-color: #f1f8df;
}

body:not(#loginBody) #msg_warning,
body:not(#loginBody) .warning-banner,
body:not(#loginBody) #warning_bar {
    border-color: var(--ed-yellow);
    background-color: #fff8d6;
}

body:not(#loginBody) #msg_error,
body:not(#loginBody) .error-banner,
body:not(#loginBody) #error_bar {
    border-color: var(--ed-red);
    background-color: #fff0ec;
}

body:not(#loginBody) #footer {
    display: none;
}

/* Client portal: preserve the ED RED language while replacing osTicket's
   fixed 840px canvas with a fluid, touch-friendly layout. */
body.edred-client {
    min-width: 0;
}

body.edred-client #container,
body.edred-client #header,
body.edred-client #nav,
body.edred-client #content,
body.edred-client #ticketForm,
body.edred-client #clientLogin {
    box-sizing: border-box;
}

body.edred-client #container {
    max-width: 980px;
}

body.edred-client #header #logo {
    float: left;
}

body.edred-client #header .pull-right {
    max-width: calc(100% - 220px);
}

body.edred-client #nav {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    box-sizing: border-box;
    height: auto;
    min-height: 50px;
    padding: 8px 18px 0;
    white-space: nowrap;
}

body.edred-client #nav li {
    flex: 0 0 auto;
}

body.edred-client #nav li a {
    box-sizing: border-box;
    min-height: 34px;
    margin: 0;
    padding-top: 7px;
    padding-bottom: 7px;
    border-radius: 9px 9px 0 0;
    color: var(--ed-plum);
    font-weight: 750;
    line-height: 20px;
}

body.edred-client #nav li a.active,
body.edred-client #nav li a:hover {
    color: var(--ed-plum);
    background-color: var(--ed-blue);
}

body.edred-client #content {
    margin: 0;
    overflow: visible;
}

body.edred-client #landing_page .main-content {
    width: auto;
    min-width: 0;
}

body.edred-client #ticketForm > table,
body.edred-client #clientLogin > table {
    width: 100% !important;
    max-width: 100%;
    table-layout: auto;
}

body.edred-client #ticketForm td,
body.edred-client #clientLogin td {
    box-sizing: border-box;
    max-width: 100%;
}

body.edred-client #ticketForm input,
body.edred-client #ticketForm textarea,
body.edred-client #ticketForm select,
body.edred-client #clientLogin input,
body.edred-client #clientLogin textarea,
body.edred-client #clientLogin select,
body.edred-client .select2-container,
body.edred-client .redactor-box {
    max-width: 100%;
    box-sizing: border-box;
}

.edred-platform-credit {
    box-sizing: border-box;
    display: flex;
    z-index: 3;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #705a6d;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

.edred-platform-credit a {
    display: inline-flex;
    align-items: center;
}

.edred-platform-credit img {
    display: block;
    width: auto;
    height: 18px;
}

.edred-platform-credit .edred-credit-divider {
    color: var(--ed-red);
}

body#loginBody .edred-platform-credit {
    position: fixed;
    right: 16px;
    bottom: 14px;
    left: 16px;
    width: fit-content;
    max-width: calc(100vw - 32px);
    margin: 0 auto;
    padding: 8px 12px;
    border: 1px solid rgba(87, 10, 82, 0.18);
    border-radius: 999px;
    background: rgba(255, 253, 232, 0.94);
}

body:not(#loginBody) .edred-platform-credit {
    width: calc(100% - 36px);
    max-width: 1180px;
    margin: -10px auto 24px;
    padding: 10px 16px;
}

body#loginBody :focus-visible,
body:not(#loginBody) :focus-visible {
    outline: 3px solid var(--ed-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 1px var(--ed-plum);
}

@media (max-width: 860px) {
    body#loginBody #brickwall,
    body#loginBody #background {
        background-position: 52% 54%;
    }

    body#loginBody #brickwall::after {
        position: absolute;
        inset: 0;
        content: "";
        background: rgba(182, 234, 244, 0.66);
    }

    body#loginBody #loginBox {
        top: 54%;
        right: 50%;
        width: min(430px, calc(100vw - 32px));
        padding: 28px 28px 30px;
        transform: translate(50%, -50%);
    }

    body:not(#loginBody) #container {
        width: calc(100% - 16px);
        margin-top: 8px;
    }

    body:not(#loginBody) #header {
        height: auto;
        min-height: 104px;
    }

    body:not(.edred-client):not(#loginBody) #header #logo {
        float: none;
        display: block;
        margin: 0 auto;
        background-position: center;
    }

    body:not(#loginBody) #header #info,
    body:not(#loginBody) #header p {
        float: none;
        clear: both;
        max-width: none;
        margin: 0 12px 10px;
        text-align: left;
    }

    body:not(#loginBody) #nav,
    body:not(#loginBody) #sub_nav {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    body:not(#loginBody) #content {
        padding: 22px 16px 32px;
        overflow-x: auto;
    }

    .edred-platform-credit {
        flex-wrap: wrap;
        row-gap: 4px;
    }
}

@media (max-width: 680px) {
    body:not(#loginBody) #container {
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    body:not(#loginBody) #header {
        min-height: 118px;
        padding: 0 10px 10px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    body:not(#loginBody) #header #logo,
    body.edred-client #header #logo {
        float: none;
        display: block;
        width: 154px;
        height: 66px;
        margin: 0 auto;
        background-position: center;
        background-size: 138px auto;
    }

    body.edred-client #header .pull-right {
        float: none;
        max-width: none;
    }

    body:not(#loginBody) #header #info,
    body:not(#loginBody) #header p {
        box-sizing: border-box;
        width: auto;
        margin: 0 4px 6px;
        padding: 7px 10px;
        font-size: 12px;
        text-align: center;
    }

    body:not(#loginBody) #nav,
    body.edred-client #nav {
        min-height: 46px;
        padding: 7px 10px 0;
        border-right: 0;
        border-left: 0;
    }

    body.edred-client #nav {
        flex-wrap: nowrap;
        justify-content: center;
        overflow-x: visible;
        padding-bottom: 7px;
    }

    body.edred-client #nav li {
        flex: 1 1 0;
        min-width: 0;
    }

    body.edred-client #nav li a {
        width: 100%;
        min-height: 32px;
        padding: 6px 3px;
        background-image: none;
        font-size: 11.5px;
        text-align: center;
        white-space: normal;
    }

    body:not(#loginBody) #sub_nav {
        padding: 6px 10px;
    }

    body:not(#loginBody) #content {
        min-height: 420px;
        padding: 20px 12px 28px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    body:not(#loginBody) #content h1 {
        font-size: 25px;
        line-height: 1.15;
    }

    body:not(#loginBody) #content h2 {
        font-size: 22px;
        line-height: 1.2;
    }

    body.edred-client #landing_page .sidebar,
    body.edred-client #landing_page .main-content {
        float: none;
        width: 100%;
        margin: 0;
    }

    body.edred-client #landing_page .sidebar {
        margin-bottom: 20px;
    }

    body.edred-client #landing_page .front-page-button,
    body.edred-client #landing_page .front-page-button p,
    body.edred-client #landing_page .front-page-button .button {
        box-sizing: border-box;
        width: 100%;
        text-align: center;
    }

    body.edred-client #ticketForm input[type="email"],
    body.edred-client #ticketForm input[type="text"],
    body.edred-client #ticketForm input[type="tel"],
    body.edred-client #ticketForm textarea,
    body.edred-client #ticketForm select,
    body.edred-client #clientLogin input[type="email"],
    body.edred-client #clientLogin input[type="text"],
    body.edred-client #clientLogin input[type="password"],
    body.edred-client #clientLogin textarea,
    body.edred-client #clientLogin select {
        width: 100% !important;
        min-height: 44px;
        font-size: 16px;
    }

    body.edred-client #ticketForm textarea,
    body.edred-client #clientLogin textarea {
        min-height: 130px;
    }

    body:not(.edred-client):not(#loginBody) table.list,
    body:not(.edred-client):not(#loginBody) table.dashboard-stats {
        min-width: 720px;
    }

    body:not(#loginBody) .ui-dialog,
    body:not(#loginBody) .dialog {
        box-sizing: border-box;
        max-width: calc(100vw - 16px) !important;
    }

    body:not(#loginBody) .edred-platform-credit {
        width: 100%;
        margin: 0;
        padding: 12px 10px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body#loginBody *,
    body:not(#loginBody) * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
