/* =========================================================
   MealHub+ Support Tickets – MEALDROP UI
   Frontend follows the MEALDROP red/orange/white visual system.
   Admin styles are kept functional and intentionally restrained.
========================================================= */

.mdh-support,
.mdh-admin-wrap {
  --mdh-red: #D71F27;
  --mdh-red-dark: #B9171E;
  --mdh-orange: #F05F0A;
  --mdh-dark: #222222;
  --mdh-text: #313131;
  --mdh-muted: #6B6B6B;
  --mdh-soft: #FFF5F5;
  --mdh-soft-2: #FFFAFA;
  --mdh-line: #F0DDDE;
  --mdh-line-strong: #E8C9CB;
  --mdh-success: #166534;
  --mdh-success-bg: #ECFDF5;
  --mdh-radius: 22px;
  --mdh-shadow: 0 20px 48px rgba(15, 23, 42, .08);
  font-family: 'Roboto', Arial, sans-serif;
  color: var(--mdh-text);
}

.mdh-support,
.mdh-support * {
  box-sizing: border-box;
}

.mdh-support {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 2vw, 26px) 0;
}

/* =========================================================
   HERO
========================================================= */

.mdh-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  margin: 0 0 24px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid rgba(215,31,39,.10);
  border-radius: 28px;
  background:
    radial-gradient(circle at 91% 12%, rgba(215,31,39,.10), transparent 27%),
    radial-gradient(circle at 70% 95%, rgba(240,95,10,.07), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #fffafa 100%);
  box-shadow: var(--mdh-shadow);
}

.mdh-hero::before {
  content: "";
  position: absolute;
  width: 310px;
  height: 310px;
  right: -155px;
  top: -165px;
  border: 46px solid rgba(215,31,39,.03);
  border-radius: 50%;
  pointer-events: none;
}

.mdh-hero > * {
  position: relative;
  z-index: 1;
}

.mdh-eyebrow,
.mdh-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--mdh-red);
  font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
}

.mdh-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--mdh-red);
  box-shadow: 0 0 0 5px rgba(215,31,39,.10);
}

.mdh-hero h2 {
  margin: 11px 0 10px !important;
  color: var(--mdh-dark) !important;
  font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif !important;
  font-size: clamp(34px, 4vw, 50px) !important;
  font-weight: 700 !important;
  font-style: italic !important;
  line-height: .98 !important;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.mdh-hero p {
  max-width: 650px;
  margin: 0 !important;
  color: var(--mdh-muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
}

.mdh-hero-actions,
.mdh-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* =========================================================
   BUTTONS
========================================================= */

.mdh-btn,
.mdh-btn:link,
.mdh-btn:visited,
.mdh-btn:focus,
.mdh-btn:active {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  min-height: 48px !important;
  padding: 13px 22px !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-style: italic !important;
  line-height: 1 !important;
  text-transform: uppercase;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.mdh-btn-primary,
.mdh-btn-primary:link,
.mdh-btn-primary:visited {
  background: var(--mdh-red) !important;
  color: #fff !important;
  border-color: var(--mdh-red) !important;
  box-shadow: 0 10px 24px rgba(215,31,39,.23);
}

.mdh-btn-primary:hover {
  background: var(--mdh-red-dark) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 14px 29px rgba(215,31,39,.28);
}

.mdh-btn-light,
.mdh-btn-secondary,
.mdh-btn-light:link,
.mdh-btn-secondary:link,
.mdh-btn-light:visited,
.mdh-btn-secondary:visited {
  background: #fff !important;
  color: var(--mdh-dark) !important;
  border-color: var(--mdh-line-strong) !important;
  box-shadow: 0 5px 14px rgba(15,23,42,.04);
}

.mdh-btn-light:hover,
.mdh-btn-secondary:hover {
  border-color: rgba(215,31,39,.28) !important;
  color: var(--mdh-red) !important;
  transform: translateY(-1px);
}

.mdh-btn-ghost,
.mdh-btn-ghost:link,
.mdh-btn-ghost:visited {
  background: rgba(255,255,255,.68) !important;
  color: var(--mdh-red) !important;
  border-color: rgba(215,31,39,.18) !important;
}

/* =========================================================
   CARDS
========================================================= */

.mdh-card,
.mdh-admin-card {
  background: #fff;
  border: 1px solid var(--mdh-line);
  border-radius: var(--mdh-radius);
  padding: clamp(22px, 3vw, 32px);
  margin-bottom: 22px;
  box-shadow: 0 14px 36px rgba(15,23,42,.055);
}

.mdh-form-card,
.mdh-reply-card {
  position: relative;
  overflow: hidden;
}

.mdh-form-card::before,
.mdh-reply-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--mdh-red), var(--mdh-orange));
}

.mdh-card-head,
.mdh-ticket-title,
.mdh-admin-ticket-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.mdh-card-head h3,
.mdh-ticket-title h3,
.mdh-admin-ticket-heading h1 {
  margin: 6px 0 0 !important;
  color: var(--mdh-dark) !important;
  font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif !important;
  font-weight: 700 !important;
}

.mdh-card-head h3,
.mdh-ticket-title h3 {
  font-size: clamp(25px, 3vw, 33px) !important;
  line-height: 1.05 !important;
}

.mdh-count {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid var(--mdh-line);
  border-radius: 999px;
  background: var(--mdh-soft-2);
  color: var(--mdh-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* =========================================================
   FORM
========================================================= */

.mdh-form {
  margin: 0;
}

.mdh-grid-2 {
  display: grid;
  grid-template-columns: minmax(180px, .72fr) minmax(0, 1.28fr);
  gap: 16px;
}

.mdh-field {
  display: block;
  margin: 0 0 18px;
}

.mdh-field > span {
  display: block;
  margin: 0 0 8px;
  color: var(--mdh-dark);
  font-size: 13px;
  font-weight: 700;
}

.mdh-field input,
.mdh-field select,
.mdh-field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #DED6D7;
  border-radius: 13px;
  background: #fff;
  color: var(--mdh-text);
  padding: 13px 14px;
  font: inherit;
  font-size: 14px;
  box-shadow: inset 0 1px 1px rgba(15,23,42,.02);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.mdh-field textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.55;
}

.mdh-field input::placeholder,
.mdh-field textarea::placeholder {
  color: #9A9495;
}

.mdh-field input:focus,
.mdh-field select:focus,
.mdh-field textarea:focus {
  outline: none;
  border-color: rgba(215,31,39,.68);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(215,31,39,.09);
}

.mdh-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding-top: 4px;
}

.mdh-form-footer p {
  max-width: 650px;
  margin: 0 !important;
  color: var(--mdh-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* =========================================================
   NOTICES
========================================================= */

.mdh-notice {
  padding: 14px 17px;
  margin: 0 0 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
}

.mdh-notice-success {
  background: var(--mdh-success-bg);
  color: var(--mdh-success);
  border: 1px solid #C8EAD3;
}

.mdh-notice-error {
  background: #FFF1F1;
  color: #991B1B;
  border: 1px solid #F3CACA;
}

/* =========================================================
   TICKET LIST
========================================================= */

.mdh-ticket-list {
  border-top: 1px solid var(--mdh-line);
}

.mdh-ticket-row,
.mdh-ticket-row:link,
.mdh-ticket-row:visited {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding: 19px 8px;
  border-bottom: 1px solid var(--mdh-line);
  color: var(--mdh-text) !important;
  text-decoration: none !important;
  transition: background .18s ease, padding .18s ease;
}

.mdh-ticket-row:hover {
  padding-left: 14px;
  padding-right: 14px;
  background: linear-gradient(90deg, rgba(215,31,39,.035), rgba(240,95,10,.018));
}

.mdh-ticket-row:hover h4 {
  color: var(--mdh-red) !important;
}

.mdh-ticket-main {
  min-width: 0;
}

.mdh-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--mdh-muted);
  font-size: 11px;
}

.mdh-ticket-meta strong {
  color: var(--mdh-red);
  font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
  font-weight: 700;
  letter-spacing: .35px;
}

.mdh-ticket-main h4 {
  margin: 6px 0 5px !important;
  color: var(--mdh-dark) !important;
  font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

.mdh-updated {
  color: var(--mdh-muted);
  font-size: 11px;
}

.mdh-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}

.mdh-status-open {
  background: #FFF1F1;
  color: #A5181E;
  border: 1px solid #F0C8CA;
}

.mdh-status-in_progress {
  background: #FFF4EC;
  color: #A3430B;
  border: 1px solid #F4D6C1;
}

.mdh-status-waiting_partner {
  background: #FFF9E8;
  color: #805D0B;
  border: 1px solid #F0E0AF;
}

.mdh-status-waiting_mealdrop {
  background: #F3F4F6;
  color: #3F4650;
  border: 1px solid #DEE1E5;
}

.mdh-status-resolved {
  background: #ECFDF5;
  color: #166534;
  border: 1px solid #C8EAD3;
}

.mdh-empty {
  padding: 48px 22px;
  text-align: center;
  color: var(--mdh-muted);
}

.mdh-empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--mdh-dark);
  font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
  font-size: 21px;
}

.mdh-empty p {
  margin: 0 !important;
}

/* =========================================================
   TICKET DETAIL / CHAT
========================================================= */

.mdh-ticket-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 15px;
}

.mdh-back,
.mdh-back:link,
.mdh-back:visited {
  color: var(--mdh-dark) !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
}

.mdh-back:hover {
  color: var(--mdh-red) !important;
}

.mdh-ticket-title p {
  margin: 8px 0 0 !important;
  color: var(--mdh-muted);
  font-size: 12px;
}

.mdh-thread {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--mdh-line);
}

.mdh-message {
  position: relative;
  max-width: min(82%, 760px);
  padding: 16px 18px;
  border-radius: 18px;
  box-shadow: 0 7px 18px rgba(15,23,42,.04);
}

.mdh-message-partner {
  align-self: flex-end;
  background: var(--mdh-soft);
  border: 1px solid #F1D5D7;
  border-bottom-right-radius: 6px;
}

.mdh-message-mealdrop {
  align-self: flex-start;
  background: var(--mdh-dark);
  color: #fff;
  border: 1px solid var(--mdh-dark);
  border-bottom-left-radius: 6px;
}

.mdh-message-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
  font-size: 11px;
}

.mdh-message-head strong {
  font-weight: 700;
}

.mdh-message-head span {
  color: var(--mdh-muted);
}

.mdh-message-mealdrop .mdh-message-head span {
  color: #B9BDC4;
}

.mdh-message-mealdrop .mdh-message-head strong {
  color: #fff;
}

.mdh-message-body {
  line-height: 1.58;
  white-space: normal;
  overflow-wrap: anywhere;
}

.mdh-message-mealdrop .mdh-message-body {
  color: #F4F4F5;
}

.mdh-login {
  max-width: 720px;
  margin: 28px auto;
  text-align: center;
  background:
    radial-gradient(circle at 88% 10%, rgba(215,31,39,.08), transparent 28%),
    #fff;
}

.mdh-login h3 {
  margin-top: 0 !important;
  font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif !important;
  font-size: 31px !important;
  color: var(--mdh-dark) !important;
}

.mdh-login p {
  color: var(--mdh-muted);
  margin-bottom: 22px !important;
}

.mdh-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  color: var(--mdh-muted);
  font-size: 12px;
}

/* =========================================================
   WORDPRESS ADMIN
========================================================= */

.mdh-admin-wrap {
  --mdh-border: #e2e2e2;
  --mdh-soft: #f7f7f8;
  max-width: 1460px;
}

.mdh-admin-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0;
}

.mdh-admin-title h1 {
  margin: 3px 0 0;
}

.mdh-admin-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px,1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.mdh-stat {
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: #444;
}

.mdh-stat span {
  display: block;
  margin-bottom: 5px;
  color: #666;
  font-size: 12px;
}

.mdh-stat strong {
  color: #171717;
  font-size: 22px;
}

.mdh-admin-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.mdh-admin-filters input[type=search] {
  min-width: 320px;
}

.mdh-admin-table-wrap {
  overflow: auto;
}

.mdh-admin-table td {
  vertical-align: middle;
}

.mdh-admin-ticket-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 20px;
  align-items: start;
}

.mdh-admin-ticket-heading h1 {
  font-size: 26px;
}

.mdh-side-card h2 {
  margin-top: 0;
}

.mdh-details {
  margin: 0;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px 12px;
}

.mdh-details dt {
  color: #666;
}

.mdh-details dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {
  .mdh-hero,
  .mdh-form-footer,
  .mdh-ticket-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .mdh-hero-actions {
    width: 100%;
  }

  .mdh-grid-2,
  .mdh-admin-ticket-grid {
    grid-template-columns: 1fr;
  }

  .mdh-admin-stats {
    grid-template-columns: repeat(2,1fr);
  }

  .mdh-message {
    max-width: 92%;
  }

  .mdh-form-footer-actions {
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .mdh-support {
    padding-top: 6px;
  }

  .mdh-hero,
  .mdh-card {
    padding: 20px;
    border-radius: 18px;
  }

  .mdh-hero h2 {
    font-size: 32px !important;
  }

  .mdh-hero p {
    font-size: 13px;
  }

  .mdh-hero-actions,
  .mdh-action-group {
    width: 100%;
  }

  .mdh-btn {
    width: 100%;
  }

  .mdh-card-head,
  .mdh-ticket-title,
  .mdh-ticket-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mdh-message {
    max-width: 96%;
  }

  .mdh-message-head {
    flex-direction: column;
    gap: 3px;
  }

  .mdh-ticket-row:hover {
    padding-left: 8px;
    padding-right: 8px;
  }

  .mdh-pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}
