#container {
    box-sizing: border-box;
    max-width: 100%;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(23, 43, 77, 0.12);
}

body {
    background: #f3f6fb;
    color: #253247;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a,
.link {
    color: #1268c4;
}

a:hover,
.link:hover {
    color: #084f9e;
}

#header {
    height: auto;
    min-height: 82px;
    padding: 12px 24px;
    box-sizing: border-box;
}

#header #logo img {
    max-height: 58px;
}

#header > .pull-right {
    margin-top: 4px;
}

#header p {
    width: auto;
    color: #536278;
}

#header p a {
    margin: 0 4px;
}

#nav {
    height: auto;
    min-height: 42px;
    margin: 0 18px;
    padding: 6px 10px;
    background: #f4f7fb;
    border: 1px solid #e2e9f2;
    border-radius: 10px;
    box-shadow: none;
    white-space: normal;
}

#nav li {
    display: inline-block;
}

#nav li a {
    height: auto;
    min-height: 34px;
    line-height: 34px;
    margin: 0 3px;
    border-radius: 7px;
    color: #40516a;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#nav li a.active,
#nav li a:hover {
    background-color: #e2efff;
    color: #0759ad;
}

#content {
    margin: 0 24px;
    padding: 28px 0;
    animation: case-content-enter 0.35s ease-out both;
}

#content h1 {
    color: #173c68;
    font-size: 26px;
    line-height: 1.25;
    margin-bottom: 14px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
select,
textarea,
.select2-container .select2-selection--single {
    max-width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    box-sizing: border-box;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
select,
textarea {
    padding: 9px 11px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]):focus,
select:focus,
textarea:focus {
    border-color: #4b93e6;
    outline: 3px solid rgba(49, 130, 216, 0.14);
}

.button,
a.button,
.green.button,
.blue.button {
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    font-weight: 600;
    padding: 10px 16px;
    text-shadow: none;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.button:hover,
a.button:hover,
.green.button:hover,
.blue.button:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
}

.sidebar .content,
#clientLogin,
.ticket-view .panel,
.featured-category {
    border: 1px solid #e2e9f2;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 4px 14px rgba(23, 43, 77, 0.05);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.sidebar .content {
    padding: 16px;
}

.sidebar section .header {
    color: #173c68;
    margin-bottom: 8px;
}

.featured-category {
    padding: 16px;
    margin: 8px 0;
}

.featured-category:hover,
.sidebar .content:hover,
.ticket-view .panel:hover {
    border-color: #bfd7f2;
    box-shadow: 0 8px 22px rgba(23, 75, 130, 0.1);
    transform: translateY(-2px);
}

.search-form .search {
    min-height: 42px;
}

#ticketForm {
    padding: 22px;
    border: 1px solid #e0e9f3;
    border-radius: 12px;
    background: linear-gradient(145deg, #fff, #f8fbff);
    box-shadow: 0 8px 24px rgba(23, 66, 112, 0.08);
}

#ticketForm > table {
    width: 100% !important;
    table-layout: auto;
}

#ticketForm > table > tbody > tr > td {
    width: auto;
    padding: 8px;
}

#ticketForm > table > tbody > tr > td:first-child:not([colspan]) {
    width: 180px;
    color: #425873;
    font-weight: 600;
}

#ticketForm table.grid.form {
    width: 100%;
    margin: 12px 0;
    border-collapse: separate;
    border-spacing: 8px;
}

#ticketForm table.grid.form caption {
    padding: 12px 14px;
    border-radius: 8px;
    background: #eaf4ff;
    color: #174e7e;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

#ticketForm table.grid.form > tbody > tr > td {
    padding: 7px;
    vertical-align: top;
}

#ticketForm input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="reset"]):not([type="button"]):not([type="file"]):not([type="hidden"]),
#ticketForm select,
#ticketForm textarea {
    width: 100%;
    max-width: 100%;
}

#ticketForm input[type="file"] {
    max-width: 100%;
}

#ticketForm .buttons input[type="submit"],
#clientLogin input[type="submit"] {
    min-height: 40px;
    padding: 9px 18px;
    border: 0;
    border-radius: 8px;
    background: #1768b3;
    box-shadow: 0 3px 8px rgba(23, 104, 179, 0.2);
    color: #fff;
    font-weight: 600;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#ticketForm .buttons input[type="submit"]:hover,
#clientLogin input[type="submit"]:hover {
    background: #0d579b;
    box-shadow: 0 5px 12px rgba(23, 104, 179, 0.25);
    transform: translateY(-1px);
}

#ticketForm .buttons input[type="reset"],
#ticketForm .buttons input[type="button"] {
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid #d5e0ec;
    border-radius: 8px;
    background: #f3f7fb;
    color: #425873;
}

#clientLogin {
    display: block;
    padding: 24px;
    border: 1px solid #dce7f2;
    border-radius: 12px;
    background: linear-gradient(145deg, #fff, #f5f9ff);
    box-shadow: 0 8px 24px rgba(23, 66, 112, 0.08);
}

#clientLogin > div[style*="display:table-row"] {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
}

#clientLogin .login-box {
    display: block;
    flex: 0 1 320px;
    width: 320px;
    padding: 4px 0;
    box-shadow: none;
}

#clientLogin .login-box > div > input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    min-height: 42px;
    margin-bottom: 12px;
}

#clientLogin > div[style*="display:table-row"] > div:not(.login-box) {
    display: block !important;
    flex: 1 1 240px;
    padding: 8px 0 !important;
}

#clientLogin strong {
    color: #b42336;
}

.success-banner,
.notice-banner,
#msg_notice {
    border-color: #9dd9b0;
    border-radius: 7px;
    background-color: #eaf8ef;
}

.info-banner,
#msg_info {
    border-color: #a8d4f4;
    border-radius: 7px;
    background-color: #edf7ff;
}

.warning-banner,
#msg_warning {
    border-color: #f1d18a;
    border-radius: 7px;
    background-color: #fff8e6;
}

.error-banner,
#msg_error {
    border-color: #f2b5b5;
    border-radius: 7px;
    background-color: #fff0f0;
}

#footer {
    background: #f4f7fb;
    border-top: 1px solid #e2e9f2;
    color: #64748b;
    line-height: 1.6;
}

@keyframes case-content-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#footer a {
    color: #64748b;
}

#content img {
    max-width: 100%;
    height: auto;
}

#footer {
    padding: 12px 16px;
    box-sizing: border-box;
}

#footer #footer-logo {
    display: block;
    max-width: min(100%, 220px);
    max-height: 48px;
    width: auto;
    height: auto;
    margin: 0 auto 8px;
}

@media screen and (max-width: 840px) {
    #container {
        width: 100%;
    }
}

@media screen and (max-width: 767px) {
    body {
        background: #fff;
    }

    #container {
        width: 100%;
        box-shadow: none;
    }

    #header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
        height: auto;
        padding: 10px 14px;
    }

    #header #logo {
        float: none;
        height: auto;
        max-width: 100%;
    }

    #header #logo img {
        display: block;
        max-width: 100%;
        max-height: 56px;
    }

    #header > .pull-right {
        float: none;
        width: auto;
    }

    #header p {
        width: auto;
        padding: 0;
        font-size: 12px;
    }

    #nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        height: auto;
        margin: 0 10px;
        padding: 5px;
        white-space: normal;
    }

    #nav li {
        display: block;
    }

    #nav li a {
        margin: 2px;
    }

    #content {
        min-height: 0;
        margin: 0 12px;
        padding: 14px 0;
    }

    #landing_page {
        display: flex;
        flex-direction: column;
    }

    #landing_page .main-content {
        order: 1;
        width: auto;
        max-width: 100%;
    }

    #landing_page .sidebar {
        order: 2;
        float: none;
        width: auto;
        margin: 15px 0;
    }

    #landing_page > .clear {
        display: none;
    }

    .featured-category {
        width: 100%;
    }

    .article-headline,
    .search-form .search,
    #kb-search #topic-id {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    #kb-search #topic-id {
        float: none;
    }

    #kb-search #searchSubmit {
        float: none;
    }

    #ticketForm > table,
    #ticketTable,
    table.custom-data,
    .ticket-view table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    #ticketForm td textarea,
    #clientLogin td textarea,
    #ticketForm div textarea,
    #clientLogin div textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    #clientLogin .instructions {
        display: block;
        padding-left: 0;
        padding-right: 0;
    }

    .login-box {
        display: block;
        width: 100%;
        box-sizing: border-box;
        box-shadow: none;
    }

    #ticketForm {
        padding: 14px;
    }

    #ticketForm > table > tbody > tr > td:first-child:not([colspan]) {
        width: 120px;
    }

    #clientLogin {
        padding: 16px;
    }

    #clientLogin .login-box {
        flex-basis: 100%;
        width: 100%;
    }

    #footer {
        padding: 14px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
