@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Playfair+Display:wght@600&display=swap");

* {
  box-sizing: border-box;
}

:root {
  --bg: #f7f4ef;
  --panel: #ffffff;
  --panel-2: #f5f1ea;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-2: #f59e0b;
  --danger: #dc2626;
  --border: #e5e7eb;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  background: radial-gradient(circle at 10% 10%, #ffffff, #f7f4ef 50%, #eef2f7 100%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

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

body::before,
body::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.6;
  z-index: 0;
}

body::before {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.15), transparent 70%);
  top: -120px;
  right: -140px;
}

body::after {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18), transparent 70%);
  bottom: -140px;
  left: -120px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 28px;
  position: relative;
  z-index: 1;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 24px;
}

.landing-nav {
  gap: 12px;
}

.nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.brand {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.brand-title {
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
}

.brand-sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.brand-logo {
  width: 160px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.profile-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.profile-btn svg {
  width: 18px;
  height: 18px;
}

.profile-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.profile-menu {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 170px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 5;
}

.profile-menu.open .profile-dropdown {
  display: block;
}

.profile-dropdown a,
.profile-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
  background: var(--panel-2);
}

.profile-dropdown .profile-logout {
  color: var(--danger);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: auto;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.btn.small {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.btn.outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
}

.hero-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.select-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.select-grow {
  flex: 1;
  min-width: 220px;
}

.select-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-section {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
}

.form-section h4 {
  margin: 0 0 12px;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: pointer;
}

.toggle input {
  display: none;
}

.toggle-slider {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #e5e7eb;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.toggle-slider::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::after {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--text);
}

.hero-card ul {
  padding-left: 18px;
  margin: 12px 0 0;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.landing-section {
  margin-top: 28px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  gap: 10px;
}

.checklist li::before {
  content: "+";
  color: var(--accent);
  font-weight: 700;
  margin-right: 8px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
  animation: rise 0.5s ease;
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.field-inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.field-inline input {
  flex: 1 1 180px;
}

.field-inline .btn {
  white-space: nowrap;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea,
button {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  border-color: var(--accent);
}

button {
  background: linear-gradient(120deg, var(--accent), #0ea5a4);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.2);
}

button.secondary {
  background: #111827;
  color: #ffffff;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.table tbody tr:hover {
  background: #faf9f6;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table input,
.table select {
  padding: 8px 10px;
  border-radius: 8px;
}

.quote-items-table th {
  font-size: 0.7rem;
}

.quote-items-table td {
  vertical-align: top;
  word-break: break-word;
}

.orc-items-table {
  width: 100%;
  table-layout: fixed;
}

.orc-items-table th,
.orc-items-table td {
  white-space: normal;
}

.orc-items-table td input,
.orc-items-table td select {
  width: 100%;
  min-width: 0;
}

.orc-items-table th:nth-child(1),
.orc-items-table td:nth-child(1) {
  width: 16%;
}

.orc-items-table th:nth-child(2),
.orc-items-table td:nth-child(2) {
  width: 30%;
}

.orc-items-table th:nth-child(3),
.orc-items-table td:nth-child(3) {
  width: 8%;
}

.orc-items-table th:nth-child(4),
.orc-items-table td:nth-child(4) {
  width: 12%;
}

.orc-items-table th:nth-child(5),
.orc-items-table td:nth-child(5) {
  width: 12%;
}

.orc-items-table th:nth-child(6),
.orc-items-table td:nth-child(6) {
  width: 12%;
}

.orc-items-table th:nth-child(7),
.orc-items-table td:nth-child(7) {
  width: 10%;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--panel);
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  max-width: 840px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-close {
  background: #111827;
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.icon-btn.danger {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.3);
}

.muted {
  color: var(--muted);
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  background: #ffffff;
}

.alert.success {
  border-color: rgba(15, 118, 110, 0.4);
  color: #115e59;
  background: rgba(15, 118, 110, 0.08);
}

.alert.error {
  border-color: rgba(220, 38, 38, 0.4);
  color: #991b1b;
  background: rgba(220, 38, 38, 0.08);
}

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

.token {
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  word-break: break-all;
  color: #0f172a;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px;
  position: sticky;
  top: 0;
  min-height: 100vh;
  height: auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 20;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-nav a:hover {
  background: #f4f1ea;
  border-color: var(--border);
}

.sidebar-nav a.active {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.25);
  color: var(--accent);
}

.sidebar-group {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  margin-top: 8px;
}

.sidebar-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: #ffffff;
  cursor: pointer;
  margin-bottom: 8px;
}

.sidebar-group-title::after {
  content: ">";
  font-size: 0.85rem;
  transition: transform 0.2s ease;
  transform: rotate(90deg);
}

.sidebar-group-title:hover {
  background: #f8f5ef;
}

.sidebar-group.has-active .sidebar-group-title {
  border-color: rgba(15, 118, 110, 0.35);
  color: var(--accent);
  background: rgba(15, 118, 110, 0.08);
}

.sidebar-subnav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-group.collapsed .sidebar-subnav {
  display: none;
}

.sidebar-group.collapsed .sidebar-group-title::after {
  transform: rotate(0deg);
}

.sidebar-subnav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
  border: 1px solid transparent;
}

.sidebar-subnav a:hover {
  background: #f4f1ea;
  border-color: var(--border);
}

.sidebar-subnav a.active {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.25);
  color: var(--accent);
}

.content {
  flex: 1;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.page-title {
  margin: 0 0 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 8px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.section {
  margin-bottom: 20px;
}

.hamburger {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-weight: 600;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 10;
  pointer-events: none;
}

.menu-open .menu-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-open .sidebar {
  transform: translateX(0);
}

.auth-body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, #ffffff, #f3f7f6 55%, #e9eff4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-shell {
  width: 100%;
  max-width: 980px;
  display: grid;
  gap: 20px;
}

.auth-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: var(--panel);
}

.auth-info {
  padding: 28px;
  background: linear-gradient(140deg, rgba(15, 118, 110, 0.12), rgba(245, 158, 11, 0.12));
}

.auth-info h2 {
  margin-top: 0;
}

.auth-form {
  padding: 28px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.auth-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.auth-footer a {
  font-size: 0.9rem;
}

.tracking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.tracking-card {
  padding: 24px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.tracking-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tracking-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.tracking-meta > div {
  min-width: 0;
}

.tracking-status {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  max-width: 100%;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

.tracking-steps {
  display: grid;
  gap: 12px;
  max-width: 100%;
}

.tracking-step {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: start;
  position: relative;
  overflow-wrap: anywhere;
}

.tracking-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--status-color, var(--accent));
  margin-top: 6px;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
  position: relative;
  z-index: 1;
}

.tracking-step::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: -12px;
  width: 2px;
  background: var(--status-color, rgba(15, 118, 110, 0.2));
}

.tracking-step:last-child::after {
  display: none;
}

.quote-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  width: 100%;
  min-width: 0;
  word-break: break-word;
}

.quote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.quote-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: #f5f1ea;
}

.quote-logo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 600;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.quote-section {
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}

.quote-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.quote-total {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.quote-footer {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .nav {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 20;
    border-radius: 0;
  }

  .content {
    padding: 20px;
  }

  .hamburger {
    display: inline-flex;
  }

  .auth-body {
    padding: 24px 16px;
  }
}

@media (max-width: 720px) {
  body::before,
  body::after {
    display: none;
  }

  .container {
    padding: 14px;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
  }

  .tracking-card {
    padding: 18px;
  }

  .tracking-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .tracking-meta {
    grid-template-columns: 1fr;
  }

  .tracking-step {
    grid-template-columns: 12px 1fr;
  }

  .tracking-dot {
    width: 10px;
    height: 10px;
  }

  .tracking-step::after {
    left: 4px;
    top: 16px;
    bottom: -10px;
  }

  .quote-card {
    padding: 18px;
  }

  .quote-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .quote-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .quote-logo {
    width: 42px;
    height: 42px;
  }

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

  .quote-items-table thead {
    display: none;
  }

  .quote-items-table tbody tr {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }

  .quote-items-table tbody tr:last-child {
    border-bottom: none;
  }

  .quote-items-table tbody td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: none;
  }

  .quote-items-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

@media (max-width: 540px) {
  .quote-total-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media print {
  body {
    background: #ffffff !important;
  }

  body::before,
  body::after {
    display: none !important;
  }

  .no-print {
    display: none !important;
  }

  .panel,
  .quote-card {
    box-shadow: none !important;
    border: none !important;
  }
}
