/* USD Discovery District — Facility Rental Quotes
   Brand: Brand/ folder (logo + red #C02030) */

:root {
  --brand-red: #c02030;
  --brand-red-dark: #9a1a26;
  --brand-red-deep: #7a1520;
  --brand-red-soft: #fdf2f3;
  --brand-red-border: #f0c4c9;
  --brand-red-muted: #e8a0a8;
  --ink: #1a1a1a;
  --ink-muted: #555;
  --ink-faint: #777;
  --surface: #fff;
  --page-bg: #f5f3f3;
  --line: #ddd;
  --line-strong: #ccc;
  --focus: #c02030;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--page-bg);
}

h1, h2, h3, legend {
  font-family: Arial, Helvetica, sans-serif;
}

.screen {
  min-height: 100vh;
}

/* ----- Login ----- */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-red);
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--brand-red);
  padding: 28px 28px 20px;
}

.login-header {
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--brand-red);
  padding-bottom: 12px;
}

.login-header .brand-logo {
  display: block;
  max-width: 200px;
  max-height: 72px;
  width: auto;
  height: auto;
  margin: 0 auto 10px;
  object-fit: contain;
}

.login-header h1 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--brand-red);
}

.login-header p {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.login-box label {
  display: block;
  margin: 12px 0 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--brand-red-deep);
}

.login-box input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #999;
  font: inherit;
}

.login-box .btn {
  width: 100%;
  margin-top: 16px;
}

/* ----- Top bar ----- */
.topbar {
  background: var(--brand-red);
  color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: Arial, Helvetica, sans-serif;
}

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

.topbar-brand .brand-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  /* Logo is red on transparent — invert to white on red bar */
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

.topbar-brand strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.topbar-sub {
  display: block;
  font-size: 0.8rem;
  opacity: 0.9;
  font-weight: normal;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

/* ----- Tabs ----- */
.tabs {
  background: var(--brand-red-dark);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: Arial, Helvetica, sans-serif;
}

.tabs-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
}

.tab:hover {
  color: #fff;
}

.tab.active {
  color: #fff;
  border-bottom-color: #fff;
  font-weight: bold;
}

/* New Quote — primary action on the right of the menu */
.tabs-new-quote {
  flex-shrink: 0;
  background: #fff !important;
  border-color: #fff !important;
  color: var(--brand-red) !important;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 3px;
}

.tabs-new-quote:hover {
  background: var(--brand-red-soft) !important;
  color: var(--brand-red-dark) !important;
}

.tabs-new-quote.is-active {
  box-shadow: inset 0 0 0 2px rgba(192, 32, 48, 0.35);
  background: #fff !important;
}

/* ----- Layout ----- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: 18px 20px 22px;
}

.panel h2 {
  margin: 0 0 16px;
  color: var(--brand-red);
  font-size: 1.2rem;
  border-bottom: 2px solid var(--brand-red);
  padding-bottom: 8px;
}

/* ----- Form ----- */
fieldset {
  border: 1px solid var(--line-strong);
  margin: 0 0 16px;
  padding: 12px 14px 14px;
}

legend {
  padding: 0 6px;
  color: var(--brand-red);
  font-size: 0.85rem;
  font-weight: bold;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.field {
  flex: 1 1 180px;
  margin-bottom: 8px;
}

.field label {
  display: block;
  margin-bottom: 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--brand-red-deep);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #999;
  font: inherit;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--brand-red);
  outline-offset: -1px;
  border-color: var(--brand-red);
}

textarea.internal {
  background: #fffbeb;
}

/* ----- Total ----- */
.total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--brand-red);
  color: #fff;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-family: Arial, Helvetica, sans-serif;
}

.total-box .muted {
  color: rgba(255, 255, 255, 0.85);
}

.total-amount {
  font-size: 1.75rem;
  font-weight: bold;
}

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #666;
  background: #f5f5f5;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn:hover {
  background: #e8e8e8;
}

.btn-primary {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-red-dark);
  border-color: var(--brand-red-dark);
}

.btn-small {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.topbar .btn {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.topbar .btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* ----- Messages ----- */
.error {
  color: #9b1c1c;
  margin: 10px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

.success {
  color: #146c43;
  margin: 10px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
}

.warning {
  background: #fff3cd;
  border: 1px solid #e0c35a;
  color: #6b5200;
  padding: 8px 10px;
  margin: 8px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

.muted {
  color: #666;
}

.small {
  font-size: 0.85rem;
}

/* ----- History table ----- */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.toolbar input {
  flex: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--brand-red-soft);
  color: var(--brand-red-deep);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--brand-red-soft);
}

/* ----- Detail ----- */
.detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 6px 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.detail-grid .label {
  color: var(--ink-muted);
  font-weight: bold;
  font-size: 0.8rem;
}

.detail-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  background: #fafafa;
  font-family: Arial, Helvetica, sans-serif;
}

.detail-status label {
  font-weight: bold;
  color: var(--brand-red-deep);
  font-size: 0.85rem;
}

.detail-status select {
  width: auto;
  min-width: 140px;
}

.footer {
  text-align: center;
  padding: 14px;
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-family: Arial, Helvetica, sans-serif;
  border-top: 3px solid var(--brand-red);
  background: #fff;
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}
