
:root {
  --portal-primary: #d5003f;
  --portal-primary-dark: #a90032;
  --portal-accent: #ed174c;
  --portal-accent-dark: #bd0038;
  --portal-bg: #f7f7f8;
  --portal-surface: #ffffff;
  --portal-text: #292929;
  --portal-muted: #6e6e73;
  --portal-border: #e2e2e5;
  --portal-success: #138a5b;
  --portal-shadow: 0 14px 38px rgba(45, 24, 31, .10);
  --portal-radius: 16px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--portal-bg);
  color: var(--portal-text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--portal-primary); }
a:hover { color: var(--portal-accent-dark); }
#container { width: min(1180px, calc(100% - 32px)); margin: 22px auto 0; background: transparent; border: 0; }
#header {
  min-height: 88px; padding: 14px 22px; background: var(--portal-surface);
  border: 1px solid var(--portal-border); border-radius: var(--portal-radius) var(--portal-radius) 0 0;
  display: flex; align-items: center; justify-content: space-between;
}
#logo { height: 58px; display: flex; align-items: center; max-width: 420px; }
#logo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 58px; object-fit: contain; }
#header #logo img { max-height: 54px; max-width: 300px; width: auto; }
#header .pull-right { float: none; text-align: right; color: var(--portal-muted); }
#header p { margin: 2px 0; }
#header a { text-decoration: none; font-weight: 600; }
#nav {
  box-shadow: 0 5px 14px rgba(169,0,50,.18);
  margin: 0; padding: 0 18px; min-height: 56px; background: var(--portal-primary-dark);
  border-radius: 0 0 var(--portal-radius) var(--portal-radius); display: flex; align-items: center; gap: 4px;
}
#nav li { float: none; }
#nav li a {
  border: 0; background: transparent; color: #eaf1f8; padding: 18px 16px;
  font-size: 14px; font-weight: 700; border-radius: 8px; text-decoration: none;
}
#nav li a.active, #nav li a:hover { color: #fff; background: rgba(255,255,255,.12); }
#nav li a.home, #nav li a.kb, #nav li a.new, #nav li a.status, #nav li a.tickets { background-image: none; }
#mobile-nav-toggle { display: none; }
#content {
  width: 100%; min-height: 520px; margin: 24px 0 0; padding: 28px;
  background: var(--portal-surface); border: 1px solid var(--portal-border); border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
}
#content h1, #content h2, #content h3 { color: var(--portal-primary-dark); line-height: 1.2; }
.portal-hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 58px 54px;
  background: linear-gradient(125deg, #8f002b, var(--portal-primary) 62%, #ef3f6c);
  color: #fff;
}
.portal-hero::after {
  content: ""; position: absolute; width: 360px; height: 360px; right: -110px; top: -150px;
  border-radius: 50%; background: rgba(255,255,255,.08);
}
.portal-hero__content { position: relative; z-index: 1; max-width: 760px; }
.portal-eyebrow { display: inline-block; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; color: #ffe3eb; }
.portal-hero h1 { margin: 0 0 12px !important; color: #fff !important; font-size: clamp(34px, 5vw, 54px); }
.portal-hero p { max-width: 680px; margin: 0 0 25px; color: #fff0f4; font-size: 18px; }
.portal-search form { position: relative; display: flex; align-items: center; max-width: 720px; padding: 6px; background: #fff; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.portal-search i { margin-left: 15px; color: var(--portal-muted); font-size: 18px; }
.portal-search input.search { flex: 1; min-width: 0; height: 48px; margin: 0; padding: 0 14px; border: 0; box-shadow: none; font-size: 16px; }
.portal-search input.search:focus { outline: 0; }
.portal-search .button { min-width: 112px; height: 46px; border: 0; border-radius: 9px; }
.portal-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 24px 0; }
.portal-action-card {
  display: flex; align-items: center; gap: 16px; min-height: 128px; padding: 24px;
  background: var(--portal-surface); border: 1px solid var(--portal-border); border-radius: var(--portal-radius);
  box-shadow: 0 8px 24px rgba(72,24,40,.07); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.portal-action-card:hover { transform: translateY(-3px); border-color: #edb1c2; box-shadow: var(--portal-shadow); }
.portal-action-card--primary { border-top: 4px solid var(--portal-accent); }
.portal-action-card__icon { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--portal-primary); font-size: 22px; }
.portal-action-card--primary .portal-action-card__icon { background: var(--portal-accent); }
.portal-action-card__text { flex: 1; }
.portal-action-card__text strong { display: block; color: var(--portal-primary-dark); font-size: 19px; }
.portal-action-card__text small { display: block; margin-top: 5px; color: var(--portal-muted); font-size: 14px; }
.portal-action-card__arrow { color: #91a2b1; }
.portal-home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; }
.portal-home-grid .main-content { width: auto; float: none; }
.portal-welcome { padding: 24px; background: #fffafb; border: 1px solid var(--portal-border); border-radius: var(--portal-radius); }
.sidebar { width: auto; float: none; }
.sidebar .front-page-button { display: none; }
.sidebar .content { padding: 22px; background: #fff; border: 1px solid var(--portal-border); border-radius: var(--portal-radius); }
.sidebar .content section { margin-bottom: 22px; }
.sidebar .content .header { margin-bottom: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--portal-border); color: var(--portal-primary-dark); font-size: 16px; font-weight: 800; }
.sidebar .content section > div:not(.header) { padding: 6px 0; }
.portal-featured { margin-top: 28px; }
.featured-category { width: calc(50% - 12px); margin: 0 20px 20px 0; padding: 22px; background: #fff; border: 1px solid var(--portal-border); border-radius: var(--portal-radius); }
.featured-category:nth-of-type(even) { margin-right: 0; }
.category-name { color: var(--portal-primary-dark); font-weight: 800; }
.button, .button:visited, input[type=submit], input[type=button], input[type=reset], button {
  border: 0; border-radius: 9px; padding: 10px 18px; background: var(--portal-primary); color: #000; font-weight: 700; text-shadow: none; box-shadow: none;
}
.button:hover, input[type=submit]:hover, input[type=button]:hover, input[type=reset]:hover, button:hover { background: var(--portal-primary-dark); color: #000; }
.green.button, .green.button:visited { background: var(--portal-accent); }
.green.button:hover { background: var(--portal-accent-dark); }
input[type=text], input[type=email], input[type=password], input[type=tel], textarea, select, .select2-container .select2-choice {
  max-width: 100%; border: 1px solid #cbd6df; border-radius: 8px; background: #fff; padding: 10px 12px; min-height: 42px; box-shadow: none;
}
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(213,0,63,.18); border-color: var(--portal-primary); }
#ticketForm > table, #ticketTable, table.list { width: 100% !important; max-width: 100%; }
#ticketForm > table { border-collapse: separate; border-spacing: 0 8px; }
#ticketForm > table td { padding: 8px 10px; }
#ticketTable { border-collapse: separate; border-spacing: 0; border: 1px solid var(--portal-border); border-radius: 12px; overflow: hidden; }
#ticketTable caption { padding: 12px 16px; background: #f6f8fa; text-align: left; }
#ticketTable th { background: var(--portal-primary-dark); color: #fff; }
#ticketTable th a { color: #fff; }
#ticketTable td, #ticketTable th { padding: 12px 10px; border-color: var(--portal-border); }
.well, .search.well { background: #f6f8fa; border: 1px solid var(--portal-border); border-radius: 12px; padding: 16px; }
#msg_notice, #msg_warning, #msg_error, .notice_bar, .warning_bar, .error_bar { border-radius: 10px;}
#footer { width: min(1180px, calc(100% - 32px)); margin: 22px auto 30px; padding: 0; color: var(--portal-muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 26px; background: #fff; border: 1px solid var(--portal-border); border-radius: var(--portal-radius); }
.footer-brand strong, .footer-brand span { display: block; }
.footer-brand strong { color: var(--portal-primary-dark); font-size: 16px; }
.footer-meta { text-align: right; }
#footer p { margin: 0; }
#footer #poweredBy { display: inline; background: none; width: auto; height: auto; }
@media (max-width: 820px) {
  #container, #footer { width: min(100% - 20px, 1180px); }
  #header { border-radius: 12px; padding: 12px 16px; }
  #header .pull-right { font-size: 13px; }
  #mobile-nav-toggle { display: block; width: 100%; margin: 10px 0 0; padding: 13px 16px; border-radius: 10px; text-align: left; }
  #nav { display: none; margin-top: 8px; padding: 8px; min-height: auto; border-radius: 10px; flex-direction: column; align-items: stretch; }
  #nav.is-open { display: flex; }
  #nav li, #nav li a { display: block; width: 100%; }
  #nav li a { padding: 12px 14px; }
  #content { padding: 18px; margin-top: 14px; }
  .portal-hero { padding: 38px 26px; }
  .portal-actions, .portal-home-grid { grid-template-columns: 1fr; }
  .featured-category { width: 100%; margin-right: 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-meta { text-align: left; }
  #ticketTable { display: block; overflow-x: auto; white-space: nowrap; }
}
@media (max-width: 560px) {
  #header { align-items: flex-start; gap: 10px; }
  #header #logo { max-width: 52%; height: 46px; }
  #header #logo img { max-width: 100%; max-height: 46px; }
  #header .pull-right { max-width: 48%; }
  .portal-hero { padding: 30px 20px; }
  .portal-hero p { font-size: 16px; }
  .portal-search form { flex-wrap: wrap; background: transparent; box-shadow: none; padding: 0; gap: 8px; }
  .portal-search i { display: none; }
  .portal-search input.search { width: 100%; flex-basis: 100%; border-radius: 9px; padding: 0 14px; }
  .portal-search .button { width: 100%; }
  .portal-action-card { padding: 18px; }
  #ticketForm > table, #ticketForm > table tbody, #ticketForm > table tr, #ticketForm > table td { display: block; width: 100% !important; }
  #ticketForm > table td { padding: 5px 0; }
}
