/* WHCC Operations Tool Kit V2 polish layer
   Applies a consistent internal app shell, mobile behavior, and print safety across legacy tools. */
:root {
  --ops-navy: #163368;
  --ops-navy-2: #0f2349;
  --ops-green: #316B35;
  --ops-cream: #f7f6f1;
  --ops-paper: #ffffff;
  --ops-border: #dedbd1;
  --ops-muted: #687076;
  --ops-ink: #1f2528;
  --ops-radius: 18px;
  --ops-shadow: 0 18px 45px rgba(15, 35, 73, 0.10);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(180deg, #fbfaf6 0%, var(--ops-cream) 100%) !important;
  color: var(--ops-ink);
}

.whcc-ops-topbar,
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--ops-navy-2), var(--ops-navy)) !important;
  color: #fff !important;
  border-bottom: 3px solid var(--ops-green) !important;
  box-shadow: 0 12px 26px rgba(15, 35, 73, 0.18);
}

.whcc-ops-topbar {
  padding: 14px clamp(16px, 4vw, 38px);
}

.whcc-ops-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.whcc-ops-topbar__left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.whcc-ops-home,
.btn-home {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.10) !important;
  border: 1px solid rgba(255, 255, 255, 0.20) !important;
  font: 700 12px/1.1 Montserrat, system-ui, sans-serif !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none !important;
  white-space: nowrap;
}

.whcc-ops-home:hover,
.btn-home:hover {
  background: rgba(255, 255, 255, 0.18) !important;
}

.whcc-ops-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.whcc-ops-brand img,
.topbar-brand img {
  width: 34px !important;
  height: 34px !important;
  object-fit: contain !important;
}

.whcc-ops-titleblock {
  min-width: 0;
}

.whcc-ops-title {
  margin: 0;
  color: #fff !important;
  font: 600 clamp(16px, 2.5vw, 21px)/1.15 Lora, Georgia, serif !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whcc-ops-subtitle {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font: 500 11px/1.2 Montserrat, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whcc-ops-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.84);
  font: 700 11px/1 Montserrat, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(49, 107, 53, 0.35);
}

.container,
.main-container,
.app,
.wrapper,
.page,
main {
  max-width: min(1180px, calc(100vw - 28px));
}

.card,
.panel,
.form-card,
.tool-card,
section.card,
.content-card {
  border-radius: var(--ops-radius) !important;
  border: 1px solid var(--ops-border) !important;
  box-shadow: var(--ops-shadow) !important;
}

button,
.btn,
input[type='submit'],
input[type='button'],
a.button {
  min-height: 44px;
  touch-action: manipulation;
}

input,
select,
textarea {
  font-size: 16px !important;
}

textarea {
  min-height: 110px;
}

.whcc-mobile-actions {
  display: none;
}

@media (max-width: 820px) {
  body {
    overflow-x: hidden;
  }

  .whcc-ops-topbar,
  .topbar {
    position: sticky;
  }

  .whcc-ops-topbar__inner,
  .topbar {
    align-items: flex-start !important;
  }

  .whcc-ops-topbar__inner {
    gap: 12px;
  }

  .whcc-ops-topbar__left,
  .topbar-left {
    width: 100%;
    min-width: 0;
  }

  .whcc-ops-home,
  .btn-home {
    padding: 8px 10px !important;
    min-width: 42px;
  }

  .whcc-ops-home span,
  .btn-home span {
    display: none;
  }

  .whcc-ops-badge,
  .topbar-meta {
    display: none !important;
  }

  .whcc-ops-title {
    max-width: calc(100vw - 120px);
  }

  .whcc-ops-subtitle {
    max-width: calc(100vw - 120px);
  }

  h1 {
    font-size: clamp(1.8rem, 9vw, 2.6rem) !important;
  }

  h2 {
    font-size: clamp(1.35rem, 7vw, 1.9rem) !important;
  }

  .container,
  .main-container,
  .app,
  .wrapper,
  .page,
  main {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .page-header,
  .hero,
  .header,
  .app-header {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .card,
  .panel,
  .form-card,
  section.card,
  .content-card {
    padding: clamp(16px, 5vw, 24px) !important;
    border-radius: 16px !important;
  }

  .field-row,
  .form-row,
  .grid,
  .gp-form-grid,
  .stats-grid,
  .cards-grid,
  .button-row,
  .actions,
  .controls,
  .toolbar {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  button,
  .btn,
  input[type='submit'],
  input[type='button'],
  a.button {
    width: 100%;
    justify-content: center;
  }

  input,
  select,
  textarea {
    width: 100% !important;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media print {
  .whcc-ops-topbar,
  .topbar,
  .no-print,
  .whcc-ops-badge {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  .card,
  .panel,
  .form-card {
    box-shadow: none !important;
  }
}


/* V2.1 topbar correction: keep the custom shell off the homepage and make the compact back control readable on mobile. */
@media (max-width: 820px) {
  .whcc-ops-home span:first-child,
  .btn-home span:first-child {
    display: inline !important;
    font-size: 16px;
    line-height: 1;
  }

  .whcc-ops-home span:last-child,
  .btn-home span:last-child {
    display: none !important;
  }

  .whcc-ops-home,
  .btn-home {
    min-width: 44px;
    width: 44px;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}
