:root { --sidebar-bg: #1b1f2e; --sidebar-text: #c9cedc; --accent: #2f6fed; }

body { background: #f5f6fa; }
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 230px; flex-shrink: 0; background: var(--sidebar-bg);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1rem .75rem;
  display: flex; flex-direction: column;
}
.sidebar .biz-name { color: #8d94a8; font-size: .8rem; padding: .1rem .75rem .75rem; margin: 0; }
.sidebar .user-box {
  margin-top: auto; padding: .75rem; border-top: 1px solid rgba(255,255,255,.12);
  color: var(--sidebar-text); font-size: .9rem;
}
.sidebar .user-box a { color: #fff; text-decoration: none; }
.sidebar .user-box .role { color: #8d94a8; font-size: .78rem; }
.sidebar .brand {
  display: block; background: #fff; border-radius: 6px;
  text-decoration: none; padding: .35rem .5rem; margin: 0 .25rem .75rem;
}
.sidebar .brand-logo { display: block; width: 100%; max-width: 190px; height: auto; }
.sidebar a.nav-item {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem;
  margin-bottom: 2px; border-radius: 6px; color: var(--sidebar-text); text-decoration: none;
}
.sidebar a.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar a.nav-item.active { background: var(--accent); color: #fff; }

/* Main area */
.main { flex: 1; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.page-header {
  background: #fff; border-bottom: 1px solid #e3e6ef; padding: 1rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.page-body { padding: 1.5rem; flex: 1; }
.app-footer {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem 1.5rem;
  flex-wrap: wrap; padding: .85rem 1.5rem; border-top: 1px solid #e3e6ef;
  background: #fff; color: #6b7280; font-size: .82rem;
}
.app-footer a { color: #2f6fed; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.job-total-card { border-left: 4px solid var(--accent); }
.job-total-card .total-amount { font-size: 1.65rem; font-weight: 700; }
.quote-logo-frame { width: 150px; height: 62px; flex: 0 0 150px; display: flex; align-items: center; overflow: hidden; }
.quote-business-logo { display: block; width: auto; max-width: 100%; height: auto; max-height: 100%; object-fit: contain; }
.quote-document-title > div:first-child { font-size: 1.75rem; line-height: 1.1; }
.quote-grand-total { border-top: 2px solid #dce3ef; font-weight: 700; }
.quote-grand-total td { padding-top: .65rem; }

/* Lists */
.list-card { background: #fff; border: 1px solid #e3e6ef; border-radius: 8px; overflow: hidden; }
.list-table th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: #6b7280; background: #fafbfd; white-space: nowrap; padding: .75rem 1rem;
}
.list-table td { padding: .85rem 1rem; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover { background: #f0f5ff; }
a.row-link { color: var(--accent); text-decoration: none; font-weight: 500; }

/* Phones: sidebar becomes a scrolling bar across the top */
@media (max-width: 991px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; display: flex; gap: .25rem;
    overflow-x: auto; padding: .5rem;
  }
  .sidebar .brand { display: block; flex: 0 0 150px; padding: .25rem .35rem; margin: 0 .25rem 0 0; align-self: center; }
  .sidebar .brand-logo { max-width: 150px; }
  .sidebar .biz-name { display: none; }
  .sidebar .user-box { margin: 0 0 0 auto; padding: 0 .5rem; border: 0; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
  .sidebar .user-box .role, .sidebar .user-box form button { margin: 0 !important; }
  .sidebar a.nav-item { white-space: nowrap; margin: 0; }
  .page-header, .page-body { padding-left: 1rem; padding-right: 1rem; }
  .app-footer { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 575px) {
  .quote-document-card .card-body { padding: 1rem !important; }
  .quote-document-card .quote-document-title > div:first-child { font-size: 1.25rem; }
  .quote-document-card .quote-logo-frame { width: 85px; height: 48px; flex-basis: 85px; }
}
