/* ==========================================================================
   Content Normalization CSS
   Handles old Tell Systems HTML structure inside the new chrome wrapper.
   Applied AFTER shared-styles.css to override old inline styles.
   ========================================================================== */

/* --- Page title table (contains *LOGIN* badge) --- */
.content-card > p > table:first-of-type,
.content-card > table:first-of-type {
  width: 100%;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.75rem;
}

.content-card > p > table:first-of-type td:first-child,
.content-card > table:first-of-type td:first-child {
  font-size: 1.4rem !important;
  font-weight: 700;
  font-family: 'Open Sans', sans-serif !important;
  color: #1a365d;
  width: auto !important;
}

.content-card > p > table:first-of-type td:last-child,
.content-card > table:first-of-type td:last-child {
  font-size: 0.85rem !important;
  font-family: 'Open Sans', sans-serif !important;
  color: #2b7bb9;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* --- Override old font tags --- */
.content-card font {
  font-family: 'Open Sans', sans-serif !important;
}

.content-card font[color="#FF0000"],
.content-card font[color="#ff0000"] {
  color: #e53e3e;
  font-weight: 600;
}

/* --- Form normalization --- */
.content-card form {
  margin-top: 1rem;
}

.content-card form table {
  border-collapse: collapse;
}

.content-card form td {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
  font-family: 'Open Sans', sans-serif;
}

.content-card input[type="text"],
.content-card input[type="password"],
.content-card input[type="email"] {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.content-card input[type="text"]:focus,
.content-card input[type="password"]:focus {
  border-color: #2b7bb9;
  outline: none;
  box-shadow: 0 0 0 2px rgba(43, 123, 185, 0.2);
}

.content-card select {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  background: white;
}

.content-card input[type="submit"],
.content-card button[type="submit"] {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  background: #2b7bb9;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.content-card input[type="submit"]:hover,
.content-card button[type="submit"]:hover {
  background: #1e5a8a;
}

.content-card input[type="reset"] {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  padding: 0.5rem 1.5rem;
  background: #e2e8f0;
  color: #4a5568;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  cursor: pointer;
}

/* --- Clean up excessive <br> tags --- */
.content-card br + br + br {
  display: none;
}

/* --- Old header images div (stripped but may remain) --- */
.content-card .header-images {
  display: none;
}

/* --- Horizontal rules --- */
.content-card hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 1rem 0;
}

/* --- Links inside content --- */
.content-card a {
  color: #2b7bb9;
  text-decoration: none;
}

.content-card a:hover {
  text-decoration: underline;
}

/* --- Tables for data display (results pages) --- */
.content-card table[border="1"],
.content-card table.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.content-card table[border="1"] td,
.content-card table[border="1"] th {
  padding: 0.4rem 0.6rem;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.content-card table[border="1"] th,
.content-card table[border="1"] tr:first-child td {
  background: #2b7bb9;
  color: white;
  font-weight: 600;
}

/* --- Wide document mode (freight bill, print-ready pages) --- */
/* Hide sidebar and expand content to full width */
body.wide-document .sidebar {
  display: none;
}
body.wide-document .content-area {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
}
body.wide-document .content-card {
  max-width: 100%;
  border-radius: 0;
  box-shadow: none;
  padding: 15px 20px;
}
/* Don't normalize tables in wide documents - preserve production layout */
body.wide-document .content-card table {
  /* Reset any normalize overrides */
}
body.wide-document .content-card input[type="submit"],
body.wide-document .content-card button[type="submit"] {
  /* Keep button styling */
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 16px;
  background: #2b7bb9;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
body.wide-document .content-card input[type="button"] {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  padding: 6px 16px;
  background: #e2e8f0;
  color: #4a5568;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  cursor: pointer;
}

/* --- Error messages --- */
.content-card .error-message,
.content-card font[color="#FF0000"] {
  display: block;
  margin: 0.5rem 0;
}

/* --- Checkbox alignment --- */
.content-card input[type="checkbox"] {
  margin-right: 0.3rem;
  vertical-align: middle;
}
