:root {
    --portal-blue: #1f84bd;
    --portal-blue-dark: #176f9c;
    --portal-green: #5acb57;
    --portal-bg: #f3f3f3;
    --portal-text: #222;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    letter-spacing: 0;
}

.wrapper {
    min-height: 100vh;
    background: var(--portal-bg);
}

.portal-navbar.navbar {
    min-height: 76px;
    margin: 0 0 32px;
    border: 0;
    border-radius: 0;
    background: var(--portal-blue);
    box-shadow: none;
}

.portal-navbar .navbar-brand {
    display: flex;
    width: 205px;
    height: 76px;
    align-items: center;
    padding: 12px 15px;
}

.portal-navbar .portal-logo {
    display: block;
    width: 175px;
    height: auto;
    max-height: 52px;
    object-fit: contain;
}

.portal-navbar .navbar-nav > li > a {
    min-height: 42px;
    margin-top: 17px;
    padding: 10px 12px;
    color: #fff;
    line-height: 20px;
    text-shadow: none;
}

.portal-navbar .navbar-nav > li > a:hover,
.portal-navbar .navbar-nav > li > a:focus {
    background: var(--portal-blue-dark);
    color: #fff;
}

.portal-navbar .navbar-nav > .active > a,
.portal-navbar .navbar-nav > .active > a:hover,
.portal-navbar .navbar-nav > .active > a:focus {
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: transparent;
    color: #fff;
}

.portal-navbar .portal-user > a {
    color: rgba(255, 255, 255, 0.68);
}

.portal-navbar .navbar-toggle {
    margin-top: 20px;
    border-color: #fff;
}

.portal-navbar .navbar-toggle .icon-bar {
    background: #fff;
}

.portal-navbar .navbar-toggle:hover,
.portal-navbar .navbar-toggle:focus {
    background: var(--portal-blue-dark);
}

.portal-shell {
    padding-bottom: 48px;
}

.portal-content {
    float: none;
    min-height: 360px;
    padding-top: 0 !important;
    background: transparent !important;
}

.portal-content h1,
.portal-content h2 {
    color: var(--portal-blue);
    font-weight: 400;
}

.portal-content h1 {
    font-size: 36px;
}

.portal-content h2 {
    font-size: 23px;
}

.portal-landing {
    padding-top: 8px;
}

.portal-landing h1 {
    margin: 0 0 10px;
}

.portal-landing p {
    max-width: 900px;
    margin-bottom: 28px;
}

.portal-primary-action {
    width: 330px;
    max-width: 100%;
    border-color: #4fc44c;
    background: var(--portal-green);
    font-size: 16px;
}

.portal-primary-action:hover,
.portal-primary-action:focus {
    border-color: #43ae40;
    background: #4aba47;
}

#content form,
#content table,
#ticketTable,
#ticketInfo {
    max-width: 100%;
}

#ticketTable,
#ticketInfo {
    width: 100% !important;
}

#ticketTable thead,
#ticketInfo .headline {
    background: rgba(35, 137, 191, 0.42);
}

#ticketTable th,
#ticketTable td {
    padding: 8px 10px;
}

#ticketTable thead a {
    color: #fff;
}

#content input[type="text"],
#content input[type="email"],
#content input[type="password"],
#content select,
#content textarea {
    max-width: 100%;
    border: 1px solid #c8d1d5;
    border-radius: 2px;
}

#content input[type="submit"],
#content input[type="button"],
#content input[type="reset"],
#content button {
    min-height: 36px;
}

#reply textarea,
#ticketForm textarea {
    width: 100% !important;
}

.portal-open-page {
    width: 100%;
}

.portal-open-page > h1 {
    margin-bottom: 5px;
}

.portal-open-page > p {
    margin-bottom: 24px;
}

#ticketForm .portal-ticket-form {
    width: 100% !important;
    table-layout: fixed;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 4px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

#ticketForm .portal-client-summary {
    display: none;
}

#ticketForm .portal-topic-heading td {
    padding: 13px 16px 11px;
    border: 0;
    border-bottom: 1px solid #c5deea;
    background: #d0e6f0;
}

#ticketForm .portal-topic-heading .form-header {
    margin: 0;
}

#ticketForm .portal-topic-heading strong,
#ticketForm .portal-topic-heading small {
    display: block;
}

#ticketForm .portal-topic-heading strong {
    margin-bottom: 5px;
    color: #222;
}

#ticketForm .portal-topic-heading small {
    color: #333;
    font-size: 12px;
    font-style: italic;
}

#ticketForm .portal-topic-heading + tr td {
    padding: 14px 16px 16px;
}

#ticketForm #topicId {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: 38px;
    padding: 7px 10px;
    background: #fff;
}

#ticketForm #dynamic-form td {
    padding: 12px 10px 6px !important;
}

#ticketForm #dynamic-form .form-header {
    margin: 0 -10px 6px !important;
    padding: 12px 16px;
    border: 1px solid #c5deea;
    background: #dceff8;
}

#ticketForm #dynamic-form .form-header h3 {
    margin: 0 0 5px;
    color: #222;
    font-size: 16px;
    font-weight: 700;
}

#ticketForm input[type="text"],
#ticketForm input[type="email"],
#ticketForm select,
#ticketForm textarea {
    width: 100%;
    padding: 8px 10px;
}

#ticketForm .portal-form-actions {
    margin-top: 20px;
    text-align: left;
}

#ticketForm .portal-form-actions .btn {
    margin: 0 8px 8px 0;
}

#ticketForm .portal-form-divider {
    margin: 62px 0 20px;
    border: 0;
    border-top: 1px solid #e4e4e4;
}

#clientLogin {
    max-width: 760px;
    margin-top: 22px;
}

#clientLogin .login-box {
    min-width: 340px;
}

#clientLogin #username,
#clientLogin #passwd {
    display: block;
    width: 340px;
    max-width: 100%;
    height: 38px;
    margin-bottom: 12px;
    padding: 8px 10px;
}

#clientLogin .btn-success {
    min-width: 125px;
    color: #fff;
}

.search.well {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.portal-ticket-list {
    color: #333;
}

.portal-ticket-search {
    display: grid;
    grid-template-columns: minmax(320px, 1.65fr) minmax(360px, 1fr);
    gap: 42px;
    align-items: center;
    margin: 0 0 26px;
}

.portal-keyword-search {
    display: flex;
    min-width: 0;
}

.portal-keyword-search input[type="text"] {
    width: 100%;
    height: 36px;
    padding: 7px 12px;
    border-right: 0 !important;
    border-radius: 2px 0 0 2px !important;
}

.portal-keyword-search button {
    min-width: 76px;
    height: 36px;
    min-height: 36px !important;
    padding: 7px 15px;
    border: 1px solid #55bed5;
    border-radius: 0 3px 3px 0;
    background: #62c4d8;
    color: #fff;
}

.portal-topic-filter {
    display: grid;
    grid-template-columns: auto minmax(210px, 1fr);
    gap: 20px;
    align-items: center;
}

.portal-topic-filter label {
    margin: 0;
    color: #2389bf;
    font-weight: 400;
    white-space: nowrap;
}

.portal-topic-filter select {
    width: 100%;
    height: 36px;
    padding: 6px 12px;
    background: #fff;
}

.portal-clear-filters {
    margin: -14px 0 18px;
}

.portal-clear-filters a {
    color: #777;
}

.portal-ticket-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.portal-ticket-summary {
    min-width: 320px;
}

.portal-ticket-title-row {
    display: flex;
    align-items: baseline;
    gap: 54px;
}

.portal-ticket-title-row h1 {
    margin: 0 0 8px;
    color: #2389bf;
    font-size: 24px;
    font-weight: 500;
}

.portal-ticket-title-row span {
    font-size: 16px;
}

.portal-ticket-showing {
    display: block;
    font-size: 14px;
}

.portal-ticket-actions {
    display: flex;
    min-width: 250px;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
}

.portal-refresh,
.portal-ticket-actions .states {
    color: #2389bf;
}

.portal-ticket-actions .state {
    color: #2389bf;
    text-decoration: underline;
}

.portal-ticket-actions .state.active {
    color: #176f9c;
    font-weight: 600;
}

.portal-state-divider {
    margin: 0 14px;
    color: #ccc;
}

.portal-ticket-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.portal-ticket-list #ticketTable {
    min-width: 720px;
    border-collapse: collapse;
}

.portal-ticket-list #ticketTable thead {
    background: #9fcfe2;
}

.portal-ticket-list #ticketTable th,
.portal-ticket-list #ticketTable td {
    height: 31px;
    padding: 5px 8px;
    border: 0;
    text-align: left;
}

.portal-ticket-list #ticketTable th,
.portal-ticket-list #ticketTable th a {
    color: #fff;
    font-weight: 700;
}

.portal-ticket-list #ticketTable tbody tr:nth-child(odd) {
    background: #dceff6;
}

.portal-ticket-list #ticketTable tbody tr:nth-child(even) {
    background: #f1f7f9;
}

.portal-pagination {
    margin-top: 28px;
}

.portal-ticket-view {
    padding-top: 14px;
    color: #3d4b57;
}

.portal-ticket-meta,
.portal-initial-request,
.portal-ticket-thread .thread-entry,
.portal-ticket-view #reply {
    box-sizing: border-box;
    width: 100%;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    overflow-wrap: anywhere;
}

.portal-initial-request,
.portal-ticket-thread .thread-entry,
.portal-ticket-view #reply {
    border: 1px solid #d5dde1;
    border-radius: 4px;
    box-shadow: none;
}

.portal-ticket-meta {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 18px;
    padding: 14px 18px;
}

.portal-ticket-view-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 7px;
}

.portal-ticket-view-heading h1 {
    margin: 0;
    color: #2389bf;
    font-size: 24px;
    font-weight: 400;
}

.portal-ticket-view-heading span {
    font-size: 14px;
    white-space: normal;
}

.portal-ticket-primary,
.portal-ticket-secondary {
    min-width: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.portal-ticket-secondary {
    align-self: center;
    padding-left: 18px;
    border-left: 3px solid #d0e6f0;
}

.portal-ticket-thread {
    display: grid;
    box-sizing: border-box;
    width: 100%;
    max-width: 960px;
    gap: 16px;
    margin: 0 auto 18px;
    padding: 0 0 2px;
    border-bottom: 0;
}

.portal-initial-request {
    margin-bottom: 16px;
    padding: 16px 20px;
    border-left: 3px solid #7f9aa8;
    background: #f7f9fa;
}

.portal-message-label {
    margin-bottom: 8px;
    color: #43515a;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.portal-initial-request .thread-body {
    min-height: 0;
}

.portal-initial-attachments {
    margin-top: 10px;
    overflow-wrap: anywhere;
}

.portal-initial-attachments a {
    display: inline-block;
    max-width: 100%;
    margin-top: 3px;
}

.portal-ticket-thread #ticketThread::before,
.portal-ticket-thread .thread-event {
    display: none !important;
}

.portal-ticket-thread .thread-entry > .avatar,
.portal-ticket-thread .thread-entry .avatar {
    display: none !important;
    position: static !important;
    float: none !important;
    width: 0 !important;
    max-width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.portal-ticket-thread #ticketThread {
    display: contents;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.portal-ticket-thread .thread-entry {
    min-width: 0;
    margin: 0;
    padding: 16px 20px;
    overflow-wrap: anywhere;
}

.portal-ticket-thread .thread-entry .header {
    display: flex !important;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0 0 9px;
    padding: 0 0 7px;
    border: 0;
    border-bottom: 1px solid #d8e0e4;
    background: transparent !important;
    color: #4d5d66;
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.portal-ticket-thread .thread-entry .header::before,
.portal-ticket-thread .thread-entry .header::after {
    display: none !important;
    content: none !important;
}

.portal-ticket-thread .thread-entry .header > .pull-right {
    order: 2;
    margin-left: auto;
}

.portal-ticket-thread .thread-entry .header time {
    white-space: normal;
}

.portal-ticket-thread .thread-entry.message {
    width: 100%;
    max-width: 960px;
    justify-self: stretch;
    border-color: #cbd5da;
    border-right: 3px solid #71808a;
    background: #f4f6f7;
}

.portal-ticket-thread .thread-entry.response {
    width: 100%;
    max-width: 960px;
    justify-self: stretch;
    border-color: #c7dce5;
    border-left: 3px solid #548ba3;
    background: #eef5f7;
}

.portal-ticket-thread .thread-entry.message .header {
    color: #34444d;
    font-weight: 600;
}

.portal-ticket-thread .thread-entry.response .header {
    color: #285d72;
    font-weight: 600;
}

.portal-ticket-thread .thread-body {
    min-height: 0;
    padding: 3px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow-wrap: anywhere;
}

.portal-ticket-thread .thread-entry .attachments,
.portal-ticket-thread .thread-entry .attachment-info,
.portal-ticket-thread .thread-entry .filename {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.portal-ticket-view #reply {
    margin: 0 auto;
    padding: 18px 20px;
    border-top: 3px solid #8aa8b5;
    background: #fbfcfc;
}

.portal-ticket-view #reply h2 {
    margin: 0 0 10px;
    color: #285d72;
    font-size: 28px;
    font-weight: 400;
}

.portal-ticket-view #reply p {
    margin-bottom: 10px;
}

.portal-ticket-view #reply textarea,
.portal-ticket-view #reply .redactor-box,
.portal-ticket-view #reply input[type="file"] {
    width: 100% !important;
    max-width: 100%;
    min-height: 90px;
    box-sizing: border-box;
}

.portal-ticket-view #reply input[type="file"] {
    min-height: 0;
}

.portal-ticket-view #reply .redactor-toolbar {
    display: none !important;
}

.portal-ticket-view #reply .redactor-editor {
    height: auto !important;
    min-height: 90px !important;
    overflow-wrap: anywhere;
}

.portal-ticket-view #msg_error,
.portal-ticket-view #msg_notice,
.portal-ticket-view #msg_warning,
.portal-ticket-view #reply .warning-banner {
    box-sizing: border-box;
    width: 100%;
    max-width: 960px;
    margin: 0 0 18px;
    padding: 11px 14px;
    border: 1px solid #d8e7f0;
    border-left: 4px solid #2389bf;
    border-radius: 4px;
    background: #fff;
    overflow-wrap: anywhere;
}

.portal-reply-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
    text-align: left;
}

.portal-reply-actions input {
    flex: 0 1 auto;
    margin-right: 0;
    max-width: 100%;
}

.portal-profile-page {
    max-width: 900px;
}

.portal-profile-page > h1 {
    margin: 0 0 6px;
    font-size: 30px;
}

.portal-profile-page > p {
    margin-bottom: 22px;
}

.portal-profile-form > table {
    width: 100% !important;
    border: 1px solid #d7d7d7;
    background: #fff;
}

.portal-profile-form > table > tbody > tr > td {
    padding: 9px 16px;
}

.portal-profile-form .form-header,
.portal-profile-form h3 {
    margin: 0;
}

.portal-profile-form .form-header {
    padding: 10px 14px;
    background: #d0e6f0;
}

.portal-profile-form h3 {
    color: #2389bf;
    font-size: 18px;
    font-weight: 500;
}

.portal-profile-form hr {
    margin: 8px 0 12px;
    border-color: #ddd;
}

.portal-profile-form input[type="text"],
.portal-profile-form input[type="email"],
.portal-profile-form input[type="password"],
.portal-profile-form select {
    width: 340px;
    max-width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    box-sizing: border-box;
}

.portal-profile-actions {
    margin-top: 18px;
    text-align: left;
}

.portal-profile-actions input {
    margin-right: 8px;
}

.portal-profile-actions input[type="submit"],
.portal-reply-actions input[type="submit"] {
    border-color: #4fc44c;
    background: var(--portal-green);
    color: #fff;
}

.alert {
    border-radius: 2px;
}

@media (max-width: 767px) {
    .portal-navbar.navbar {
        margin-bottom: 20px;
    }

    .portal-navbar .navbar-brand {
        width: 188px;
    }

    .portal-navbar .navbar-header {
        position: relative;
        min-height: 76px;
    }

    .portal-navbar .navbar-toggle {
        position: absolute;
        top: 0;
        right: 15px;
        display: block !important;
    }

    .portal-navbar .portal-logo {
        width: 158px;
    }

    .portal-navbar .navbar-collapse {
        border-color: rgba(255, 255, 255, 0.35);
    }

    .portal-navbar .navbar-nav {
        margin-top: 0;
    }

    .portal-navbar .navbar-nav > li > a {
        min-height: 40px;
        margin: 0;
        text-align: right;
    }

    .portal-content h1 {
        font-size: 23px;
    }

    .portal-open-page {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
    }

    #ticketTable {
        display: block;
        overflow-x: auto;
    }

    .portal-ticket-search {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .portal-topic-filter {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .portal-ticket-toolbar {
        flex-direction: column;
        margin-bottom: 18px;
    }

    .portal-ticket-summary {
        min-width: 0;
    }

    .portal-ticket-title-row {
        justify-content: space-between;
        gap: 16px;
    }

    .portal-ticket-actions {
        min-width: 0;
        align-items: flex-start;
        gap: 10px;
    }

    .portal-ticket-view {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .portal-ticket-meta,
    .portal-initial-request,
    .portal-ticket-thread .thread-entry,
    .portal-ticket-view #reply {
        max-width: 100%;
    }

    .portal-ticket-meta {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        margin-bottom: 14px;
        padding: 14px;
    }

    .portal-ticket-secondary {
        padding: 10px 0 0;
        border-top: 2px solid #d0e6f0;
        border-left: 0;
    }

    .portal-ticket-view-heading {
        justify-content: flex-start;
        gap: 6px 12px;
    }

    .portal-ticket-view-heading h1,
    .portal-ticket-view #reply h2,
    .portal-profile-page > h1 {
        font-size: 23px;
    }

    .portal-initial-request,
    .portal-ticket-thread .thread-entry {
        width: 100%;
        padding: 13px 14px;
    }

    .portal-ticket-thread .thread-entry.message,
    .portal-ticket-thread .thread-entry.response {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        justify-self: stretch;
    }

    .portal-ticket-thread .thread-entry .header {
        align-items: flex-start;
        gap: 3px 8px;
    }

    .portal-ticket-thread .thread-entry .header > .pull-right {
        margin-left: 0;
    }

    .portal-ticket-thread .thread-entry .header > * {
        min-width: 0;
        max-width: 100%;
    }

    .portal-ticket-view #reply {
        padding: 15px 14px;
    }

    .portal-ticket-view #reply textarea,
    .portal-ticket-view #reply .redactor-box {
        min-height: 110px;
    }

    .portal-ticket-view #reply input:disabled,
    .portal-ticket-view #reply button:disabled {
        color: #52616a;
        background-color: #e4e8ea;
        opacity: 1;
    }

    .portal-reply-actions input {
        flex: 1 1 auto;
        min-width: 0;
    }

    .portal-profile-form > table,
    .portal-profile-form > table > tbody,
    .portal-profile-form > table > tbody > tr,
    .portal-profile-form > table > tbody > tr > td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    .portal-profile-form > table > tbody > tr > td:first-child:not([colspan]) {
        padding-bottom: 2px;
    }

    #clientLogin .login-box {
        min-width: 0;
    }

    #clientLogin > div {
        display: block !important;
    }

    #clientLogin > div > div {
        display: block !important;
        padding: 0 !important;
    }
}
