:root {
  --bg-1: #f4f8ff;
  --bg-2: #edf9f0;
  --ink: #101827;
  --muted: #42526b;
  --line: #d8e4f2;
  --card: rgba(255, 255, 255, 0.9);
  --primary: #0f766e;
  --primary-strong: #0b5e58;
  --accent: #eab308;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.35;
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(14, 116, 144, 0.22), transparent 60%),
    radial-gradient(900px 550px at 100% 0%, rgba(34, 197, 94, 0.16), transparent 55%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}

.app-shell {
  width: min(1200px, calc(100% - 20px));
  max-width: 100%;
  min-width: 0;
  margin: clamp(12px, 2vw, 28px) auto 34px;
  display: grid;
  gap: 12px;
}

.panel {
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  backdrop-filter: blur(6px);
}

.hero {
  border-left: 8px solid var(--accent);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.brand h1 {
  margin: 6px 0 0;
  font-size: clamp(1.2rem, 2.2vw, 1.9rem);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: clamp(82px, 12vw, 116px);
  height: auto;
  border-radius: 8px;
  border: 1px solid #d6e0ef;
  background: #fff;
  padding: 3px;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost-link {
  color: #0f4c8a;
  text-decoration: none;
  font-weight: 700;
}

.ghost-link:hover {
  text-decoration: underline;
}

.lang-picker {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 168px;
}

.hidden {
  display: none !important;
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.app-content {
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.06rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.products-grid,
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 0;
}

.field.compact {
  max-width: 180px;
}

input,
select {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  width: 100%;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: linear-gradient(140deg, var(--primary), var(--primary-strong));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ghost-btn {
  background: #ebf0f7;
  color: var(--ink);
}

.table-wrap button {
  background: #ebf0f7;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 0.84rem;
}

.table-wrap .clear-customer-assign-btn {
  margin-left: 6px;
}

.error {
  margin: 10px 0 0;
  min-height: 1.2rem;
  color: #b91c1c;
  font-size: 0.88rem;
}

.settings-msg {
  margin: 10px 0 0;
  min-height: 1.2rem;
  color: #0f766e;
  font-size: 0.88rem;
}

.summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.summary-card {
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.summary-card .label {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.summary-card .value {
  margin: 7px 0 0;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  font-weight: 700;
}

.summary-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.analytics-head {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.customer-assign-head {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.customer-assign-head input {
  flex: 1 1 260px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-pager {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.table-pager button[disabled] {
  opacity: 0.5;
  cursor: default;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid #e4ebf7;
  padding: 10px 8px;
  text-align: left;
  font-size: 0.92rem;
  vertical-align: middle;
  white-space: normal;
  word-break: break-word;
}

th {
  background: #f8fbff;
}

@media (max-width: 980px) {
  .hero-top {
    flex-wrap: wrap;
  }

  .hero-actions {
    width: 100%;
    align-items: stretch;
  }

  .lang-picker {
    min-width: 0;
  }

  .analytics-head {
    flex-direction: column;
    align-items: stretch;
  }

  .field.compact {
    max-width: none;
  }

  .auth-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .field-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .products-grid,
  .accounts-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .customer-assign-head {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: calc(100% - 12px);
    margin-top: 8px;
  }

  .panel {
    border-radius: 12px;
    padding: 12px;
  }

  .hero-top {
    flex-direction: column;
  }

  .brand-row {
    align-items: flex-start;
  }

  .brand-logo {
    width: 68px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions > * {
    width: 100%;
  }

  .brand h1 {
    font-size: 1.45rem;
  }

  .auth-grid,
  .field-grid,
  .settings-grid,
  .products-grid,
  .accounts-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .table-wrap button {
    width: auto;
    white-space: nowrap;
  }

  .inline-actions {
    width: 100%;
  }

  .table-pager {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .table-wrap {
    border: 1px solid #dbe5f4;
    border-radius: 10px;
    background: #fff;
  }

  .table-wrap table {
    min-width: 520px;
  }

  th,
  td {
    font-size: 0.84rem;
    padding: 8px 6px;
  }
}


.notify-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d32f2f;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.notifications-list {
  display: grid;
  gap: 8px;
}

.notification-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.notification-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.notification-body {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.notification-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.notification-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-actions button {
  padding: 6px 9px;
  font-size: 0.78rem;
}

.quote-focus {
  outline: 2px solid #f3d106;
  background: #fffde7 !important;
}

.rank-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rank-actions span {
  font-size: 0.78rem;
  color: var(--muted);
}

.rank-actions .rank-review-btn {
  padding: 5px 8px;
  font-size: 0.74rem;
}

#quote-approvals-body a {
  color: #0f4c8a;
  text-decoration: none;
}

#quote-approvals-body a:hover {
  text-decoration: underline;
}
