@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: local('Open Sans'), local('OpenSans'),
       url(/admin/class/opensans.ttf) format('truetype');
}

/* =========================================================
   Base / legacy styles (kept)
   ========================================================= */
html, body { height: 100%; }

body {
  font-family: Open Sans;
  font-size: 14px;
  background-color: #FFFFFF;
  line-height: 1.25;
  margin: 0;
}

.bigcheck {
  transform: scale(3.5);
  margin: 15px;
  padding: 10px;
}

th {
  font-family: Open Sans;
  font-size: 14px;
  color: #723F2E;
  height: 20px;
  background-color: #ECCF79;
  border: 1px solid #D59446;
}

th.fieldhead {
  font-family: Open Sans;
  font-size: 14px;
  color: #723F2E;
  height: 20px;
  background-color: #ECCF79;
  border: 0;
}

TD.data_td {
  font-family: Open Sans;
  font-size: 14px;
  color: #000000;
  height: 20px;
  background-color: #FEFCFC;
  border: 1px solid #E6E4E4;
  padding: 4px 6px;
}

tr:nth-child(even) td.data_td { background: #F5FAFF; }

a.data_td,
a.data_td:active,
a.data_td:visited,
a.data_td:hover {
  font-family: Open Sans;
  font-size: 14px;
  color: #0069A5;
  text-decoration: none;
}

a.data_td:hover { text-decoration: underline; }

TD.sortinghead { height: 7px; }

#pic {
  float: left;
  margin: 0 5px 5px 0;
  width: 32px;
  height: 32px;
}

#params { font-size: 10px; color: #999999; }

.report {
  font-size: 14px;
  border: 1px solid #Dddddd;
  padding: 4px;
  color: #999999;
}

H1 {
  font-size: 14px;
  color: #858585;
  margin-bottom: 10px;
  margin-top: 0;
}

P {
  font-size: 14px;
  color: #8F8F8F;
  text-indent: 0;
  margin: 0 0 15px 0;
  line-height: 1.25;
}

.table_heading {
  font-size: 14px;
  color: #003366;
  font-weight: bold;
  background-color: #7DC6EC;
  border: 1px solid #1B7CB1;
}

.headerx {
  font-size: 14px;
  display: inline;
  color: #858585;
  text-align: center;
  font-weight: normal;
}

h3 {
  font-size: 14px;
  display: inline;
  color: #723F2E;
  font-weight: bold;
}

SELECT {
  font-size: 14px;
  color: #000000;
  padding: 2px 4px;
}

INPUT {
  font-size: 14px;
  color: #000000;
  padding: 3px 6px;
}

INPUT.inputclass { font-size: 14px; color: #000000; }

TEXTAREA.inputclass {
  font-size: 14px;
  color: #000;
  padding: 4px 6px;
}

UL { margin-top: 0; margin-bottom: 0; }

LI {
  font-size: 14px;
  margin: 0;
  text-indent: 0;
  line-height: 1.25;
  list-style-image: url(/i/arrow.gif);
}

A,
A:active,
A:visited {
  font-size: 14px;
  color: #00008F;
  text-decoration: underline;
  font-weight: bold;
}

A:hover { font-size: 14px; }

A.paging_lnk,
A.paging_lnk:active,
A.paging_lnk:visited {
  font-size: 14px;
  color: #ffffff;
  text-decoration: underline;
}

A.paging_lnk:hover {
  font-size: 14px;
  color: #003366;
  text-decoration: none;
}

.paging_selected {
  font-size: 14px;
  color: #003366;
  text-decoration: none;
  font-weight: bold;
}

/* =========================================================
   Original tabs look (DESKTOP) - keep as close as possible
   ========================================================= */
#tab {
  margin-left: 0;
  margin-bottom: 0;
  margin-top: 0;
  color: #B4C5E1;
  z-index: 6;
  padding: 0 10px 4px 6px;
}

#tab li {
  list-style: none;
  display: inline;
  margin: 0;
}

#tab li a {
  text-decoration: none;
  color: #5C0507;
  padding: 4px 10px;
  margin-right: 2px;
  border: 1px solid #42608D;
  border-bottom: none;
  background: linear-gradient(#f1cc63, #D5A421);
  border-radius: 4px 4px 0 0;
  float: left;
  position: relative;
  bottom: 0;
  left: -2px;
  font-weight: bold;
}

#tab a:hover {
  color: #FFFFFF;
  background: #218CC4;
  border-color: #333333;
}

#tab a.currenttab {
  padding: 4px 10px;
  background: linear-gradient(#2094D0, #218CC4);
  color: #FFFFFF;
  z-index: 4;
}

/* =========================================================
   Submenu
   ========================================================= */
#submenu .item A {
  font-family: Open Sans;
  font-size: 14px;
  color: #FFFF80;
  text-decoration: none;
}

#submenu .item {
  font-family: Open Sans;
  font-size: 14px;
  color: #FFFF80;
  font-weight: bolder;
  text-decoration: none;
}

#submenu .item A:hover {
  font-family: Open Sans;
  font-size: 14px;
  color: #FFFFFF;
  font-weight: bolder;
  text-decoration: none;
}

#submenu .item_active A {
  font-family: Open Sans;
  font-size: 14px;
  color: #FFFFFF;
  font-weight: bolder;
  text-decoration: none;
}

.errmsg { font-size: 14px; display: inline; color: #C43823; }
.sideText { font-family: Open Sans; font-size: 14px; font-weight: normal; }
.subTitle { font-family: Open Sans; font-size: 14px; font-weight: bold; color: #5C0507; }

.maintable {
  background: url(/i/c_t.gif) repeat-x;
  background-color: #52A1CC;
  padding: 0 1px 10px 1px;
}

.th_bg {
  background-image: url(/i/th_bg.jpg);
  background-repeat: repeat-x;
  height: 14px; /* your thin band */
}

.downloadinfo_table {
  background-color: #FFFFFF;
  border: 1px solid #4280B7;
}

.inputdata_td {
  font-family: Open Sans;
  font-size: 14px;
  color: #000000;
  height: 20px;
  background-color: #F1F5FA;
  border: 1px solid #3788B5;
  padding: 4px 6px;
}

.data_paging {
  font-family: Open Sans;
  font-size: 14px;
  color: #000000;
  height: 20px;
}

.paging {
  font-family: Open Sans;
  font-size: 14px;
  font-weight: bolder;
  color: #8F8F8F;
  height: 20px;
  background-color: #7DC6EC;
  padding: 0 0 0 2px;
}

/* =========================================================
   Responsive shell (your adminheader/adminfooter structure)
   Ensures white content fills screen; tiny blue band at bottom
   ========================================================= */
.admin-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #FFFFFF;
}

.admin-logo img {
  display: block;
  height: 60px;
  width: auto;
}

.admin-topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-btn {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #42608D;
  background: #218CC4;
  color: #FFFFFF !important;
  text-decoration: none;
  font-weight: bold;
}

.logout-btn:hover { background: #2094D0; }

.nav-toggle {
  display: none; /* shown only on mobile */
  width: 88px;
  height: 80px;
  border: 1px solid #42608D;
  background: linear-gradient(#f1cc63, #D5A421);
  cursor: pointer;
  padding: 10px 12px;
}

.nav-toggle span {
  display: block;
  height: 4px;
  margin: 6px 0;
  background: #5C0507;
}

/* Main content area: fill remaining height */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;

  /* blue background behind content */
  background: url(/i/c_t.gif) repeat-x;
  background-color: #52A1CC;

  /* IMPORTANT: remove extra padding that was showing tons of blue */
  padding: 0;
}

/* White box should stretch */
.admin-inner {
  flex: 1;
  min-height: 0;
  background: #FFFFFF;
  padding: 10px;
  box-sizing: border-box;
}

/* Add a tiny blue band at bottom only */
.admin-main::after {
  content: "";
  display: block;
  height: 10px; /* <= THIS is the bottom blue band thickness */
  flex: 0 0 10px;
}

/* Legend box width */
.admin-legend {
  border: 1px solid #4280B7;
  background: #FFFFFF;
  padding: 8px 10px;
  margin: 6px auto 10px auto;
  width: 90%;
  box-sizing: border-box;
}

.admin-legend__title {
  font-weight: bold;
  color: #5C0507;
  margin-bottom: 4px;
}

.admin-alert {
  width: 90%;
  margin: 0 auto 10px auto;
  border: 1px solid #D59446;
  background: #FFF7DF;
  color: #5C0507;
  padding: 8px 10px;
  box-sizing: border-box;
}

/* =========================================================
   Mobile nav behavior: stacked rectangles (no rounding)
   (desktop remains original #tab look)
   ========================================================= */
@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }

  .admin-nav {
    display: none;
    padding: 6px 8px 10px 8px;
    background: #FFFFFF;
    border-top: 1px solid #DDE6F0;
    border-bottom: 1px solid #DDE6F0;
  }

  .admin-nav.is-open { display: block; }

  #tab { padding: 0; margin: 0; }
  #tab li { display: block; }

  #tab li a {
    float: none;
    left: 0;
    margin: 0 0 6px 0;
    border-radius: 0 !important; /* rectangles */
    border-bottom: 1px solid #42608D;
    padding: 10px 12px;
    display: block;
  }

  .admin-legend, .admin-alert { width: 98%; }
}

/* =========================================================
   jqGrid/phpGrid: pager + toolbar mobile fixes (actual targets)
   ========================================================= */
@media (max-width: 900px) {
  .ui-jqgrid .ui-jqgrid-pager,
  .ui-jqgrid .ui-jqgrid-toppager {
    height: auto !important;
    padding: 6px 4px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .ui-jqgrid .ui-jqgrid-pager .ui-pg-table,
  .ui-jqgrid .ui-jqgrid-toppager .ui-pg-table {
    display: block !important;
    width: 100% !important;
  }

  .ui-jqgrid .ui-jqgrid-pager .ui-pg-table td,
  .ui-jqgrid .ui-jqgrid-toppager .ui-pg-table td {
    display: inline-block !important;
    padding: 4px 5px !important;
    vertical-align: middle !important;
    float: none !important;
  }

  .ui-jqgrid .ui-pg-button .ui-pg-div {
    padding: 10px 12px !important;
    margin: 2px !important;
  }

  .ui-jqgrid .ui-pg-button span.ui-icon {
    transform: scale(1.35) !important;
    transform-origin: center center !important;
    margin: 0 !important;
  }

  .ui-jqgrid .ui-pg-input,
  .ui-jqgrid .ui-pg-selbox {
    font-size: 16px !important;
    height: 34px !important;
    padding: 3px 6px !important;
  }

  .ui-jqgrid .ui-jqgrid-toppager .ui-pg-button,
  .ui-jqgrid .ui-jqgrid-pager .ui-pg-button {
    line-height: 1 !important;
  }
}

@media (max-width: 900px) {
  .ui-jqgrid .ui-jqgrid-pager .ui-pg-table td,
  .ui-jqgrid .ui-jqgrid-toppager .ui-pg-table td {
    display: inline-block !important;
    width: auto !important;
  }

  .ui-jqgrid .ui-pg-button,
  .ui-jqgrid .ui-pg-button .ui-pg-div {
    display: inline-block !important;
    width: auto !important;
    white-space: nowrap !important;
  }

  .ui-jqgrid .ui-jqgrid-pager,
  .ui-jqgrid .ui-jqgrid-toppager {
    white-space: normal !important;
  }
}

/* =========================================================
   Mobile "div cards" version of the lead list
   Desktop keeps the existing HTML table exactly as-is
   ========================================================= */
.leadcards { display: none; }

@media (max-width: 900px) {
  .downloadinfo_table .table_heading_th_row,
  .downloadinfo_table tr.data-row-tr {
    display: none !important;
  }

  .leadcards {
    display: block;
    padding: 6px 6px 10px 6px;
  }

  .leadcard {
    border: 1px solid #E6E4E4;
    background: #FEFCFC;
    margin: 10px 0;
    padding: 12px;
    box-sizing: border-box;
  }

  .leadcard__top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }

  .leadcard__id {
    min-width: 120px;
    text-align: left;
  }

  .leadcard__checks { margin-top: 8px; }

  .leadcard__who {
    flex: 1;
    min-width: 0;
  }

  .leadcard__name {
    font-weight: bold;
    font-size: 18px;
    color: #000;
    margin-bottom: 4px;
  }

  .leadcard__company,
  .leadcard__url,
  .leadcard__rating {
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
    word-break: break-word;
  }

  .leadcard__links a {
    font-size: 15px;
    color: #0069A5;
    text-decoration: none;
    font-weight: bold;
  }

  .leadcard__links a:hover { text-decoration: underline; }

  .leadcard__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
  }

  .leadcard__cell {
    border: 1px solid #E6E4E4;
    background: #F5FAFF;
    padding: 10px;
  }

  .leadcard__notes {
    border: 1px solid #E6E4E4;
    background: #FFFFFF;
    padding: 10px;
    margin-top: 10px;
  }

  .m-label {
    font-size: 12px;
    color: #5C0507;
    font-weight: bold;
    margin-bottom: 6px;
  }

  .m-value {
    font-size: 15px;
    line-height: 1.35;
    color: #000;
    word-break: break-word;
  }

  @media (orientation: portrait) { .leadcard { min-height: 48vh; } }
  @media (orientation: landscape) { .leadcard { min-height: 44vh; } }

  .leadcard__notes .m-value {
    max-height: 22vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* =========================================================
   DIV/CSS-grid version of the lead list (keeps desktop look,
   becomes big mobile cards; forces ~2 rows per mobile screen)
   ========================================================= */
.lead-grid-wrap {
  width: 98%;
  margin: 0 auto;
  border: 1px solid #4280B7;
  background: #FFFFFF;
}

.lead-grid-title {
  padding: 6px 10px;
  border-bottom: 1px solid #1B7CB1;
}

.lead-grid {
  display: grid;
  grid-template-columns: 10% 15% 13% 20% 12% 22% 8%;
  gap: 0;
}

.lead-grid--head .lead-cell { border-right: 1px solid #D59446; }
.lead-grid--head .lead-cell:last-child { border-right: 0; }

.lead-cell { box-sizing: border-box; }

.lead-th {
  font-family: Open Sans;
  font-size: 14px;
  color: #723F2E;
  background-color: #ECCF79;
  border-bottom: 1px solid #D59446;
  padding: 4px 6px;
}

.lead-grid--row .lead-cell { border-right: 1px solid #E6E4E4; }
.lead-grid--row .lead-cell:last-child { border-right: 0; }

.lead-grid--row { border-bottom: 1px solid #E6E4E4; }
.lead-grid--row:nth-of-type(even) { background: #F5FAFF; }

.lead-grid--row .data_td {
  border: 0;
  background: transparent;
  padding: 20px 8px 20px 2px;
}

.lead-grid-footer {
  padding: 8px 10px;
  border-top: 1px solid #1B7CB1;
}

.lead-notes-bar {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid #1B7CB1;
}

.lead-notes-left {
  flex: 0 0 220px;
  white-space: nowrap;
  align-self: flex-start;
}

.lead-notes-right { flex: 1; }

.lead-label {
  display: none;
  font-weight: bold;
  color: #5C0507;
  margin-bottom: 4px;
}

.lead-value {}

@media (max-width: 900px) {
  .lead-grid { grid-template-columns: 1fr; }
  .lead-grid--head { display: none; }

  .lead-grid--row {
    background: #FFFFFF;
    margin: 10px 10px;
    border: 1px solid #E6E4E4;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
    border-radius: 8px;
    min-height: 44vh;
    padding: 8px 8px;
  }

  .lead-grid--row .lead-cell {
    border-right: 0 !important;
    border-bottom: 1px solid #E6E4E4;
    padding: 10px 10px;
  }

  .lead-grid--row .lead-cell:last-child { border-bottom: 0; }

  .lead-label { display: block; }
  .lead-cell--id { text-align: left !important; }

  .bigcheck {
    transform: scale(2.4);
    margin: 10px 10px 10px 0;
  }

  .notes_table { width: 100% !important; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .lead-grid--row { min-height: 36vh; }
}

/* =========================================================
   Mobile lead cards: shorter, 3-col layout, readable notes
   ========================================================= */
.lead_card {
  border: 1px solid #E6E4E4;
  border-radius: 8px;
  background: #FFFFFF;
  padding: 10px 10px;
  margin: 10px 0;
}

.lead_grid {
  display: grid;
  grid-template-columns: 72px 1fr 140px;
  gap: 10px;
  align-items: start;
}

.lead_controls { text-align: left; }
.lead_controls .lead_id { margin-bottom: 6px; }

.lead_main { min-width: 0; }

.lead_meta {
  border-left: 1px solid #E6E4E4;
  padding-left: 10px;
  font-size: 13px;
}

.meta_row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #F0F0F0;
}

.meta_row:last-child { border-bottom: 0; }

.meta_lbl { color: #723F2E; font-weight: bold; }

.meta_val {
  color: #000;
  text-align: right;
  word-break: break-word;
}

.status_badge {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #1B7CB1;
  background: #7DC6EC;
  color: #003366;
  font-weight: bold;
  border-radius: 6px;
}

.notes_grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 6px;
}

.notes_cell {
  min-width: 0;
  word-break: break-word;
  white-space: nowrap;
}

.notes_span2 { grid-column: 1 / -1; }

@media (max-width: 520px) {
  .lead_grid { grid-template-columns: 64px 1fr; }

  .lead_meta {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid #E6E4E4;
    padding-left: 0;
    padding-top: 8px;
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .meta_row {
    border-bottom: 0;
    padding: 0;
    display: block;
  }

  .meta_val { text-align: left; }
}

@media (min-width: 700px) and (max-width: 900px) {
  .lead_grid { grid-template-columns: 72px 1fr 180px; }
}

/* =========================================================
   PATCH: Mobile hamburger menu usability fixes (keep desktop)
   - Bigger font
   - Menu stays open while scrolling
   - Menu itself scrolls
   - First menu item visible (top: 40px)
   ========================================================= */
@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }

  .admin-nav.is-open {
    display: block;
    position: fixed;
    top: 100px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 99999;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
  }

  #tab li a {
    font-size: 18px !important;
    padding: 14px 14px !important;
    line-height: 1.2;
  }
}

/* =========================================================
   Mobile row layout toggle
   Default: show DESKTOP-style table on mobile
   Optional: add class "force-cards" to show cards on mobile
   Optional: add class "force-table" to force table everywhere
   ========================================================= */

/* DEFAULT on mobile: show table rows, hide cards */
@media (max-width: 900px){
  /* show the table header + data rows again */
  .downloadinfo_table .table_heading_th_row,
  .downloadinfo_table tr.data-row-tr{
    display: table-row !important;
  }

  /* hide the card list */
  .leadcards{
    display: none !important;
  }
}

/* If you want CARDS on mobile, add class="force-cards" to <body> */
@media (max-width: 900px){
  body.force-cards .downloadinfo_table .table_heading_th_row,
  body.force-cards .downloadinfo_table tr.data-row-tr{
    display: none !important;
  }
  body.force-cards .leadcards{
    display: block !important;
  }
}

/* If you want TABLE forced even on pages that try to card-ify */
body.force-table .leadcards{
  display: none !important;
}

