@import url("../landing.css");

body.dashboard-body {
  background: var(--bg);
}

.dashboard-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 241, 236, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.dashboard-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-email {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-main {
  flex: 1;
  padding: 28px 0 56px;
}

.auth-card {
  max-width: 420px;
  margin: 48px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 36px 28px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-lead {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}

.field input:focus {
  outline: 2px solid rgba(196, 92, 38, 0.35);
  border-color: var(--accent);
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}

.link-btn:hover {
  color: var(--accent-dark);
}

.auth-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

.message {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.message-error {
  background: #fdecea;
  color: #8a1f11;
  border: 1px solid #f5c4be;
}

.message-success {
  background: #e8f5ec;
  color: #1f5c33;
  border: 1px solid #b8dfc4;
}

.loading-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

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

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

.stat-label {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stat-value {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-value-sm {
  font-size: 1.15rem;
}

.section {
  margin-bottom: 28px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #faf8f5;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.data-table tbody tr:hover {
  background: #faf8f5;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-draft {
  background: #ece8e2;
  color: #5c5c5c;
}

.badge-sent {
  background: #e8f0fa;
  color: #1a4d8c;
}

.badge-accepted {
  background: #e8f5ec;
  color: #1f5c33;
}

.badge-declined {
  background: #fdecea;
  color: #8a1f11;
}

.badge-invoiced {
  background: #f0e8f8;
  color: #5c338a;
}

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
}

.company-card {
  display: grid;
  gap: 8px;
  padding: 20px 18px;
}

.company-card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.company-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(640px, 100%);
  max-height: min(88dvh, 720px);
  overflow: auto;
  background: var(--surface);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 64px rgba(26, 26, 26, 0.2);
  padding: 24px 22px 28px;
}

.modal h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
}

.modal-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.modal-close {
  float: right;
  margin: -4px 0 8px 8px;
}

.detail-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.detail-row span:first-child {
  color: var(--muted);
}

.totals-card {
  background: #faf8f5;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.totals-card .detail-row:last-child {
  border-bottom: none;
  font-weight: 800;
  font-size: 1rem;
  padding-top: 4px;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
  }
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  padding: 16px;
}

.photo-tile {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 1;
  background: #faf8f5;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
}

.auth-footer a:hover {
  color: var(--accent-dark);
}

.dashboard-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

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

.form-panel {
  padding: 22px 20px;
}

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

.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(196, 92, 38, 0.35);
  border-color: var(--accent);
}

.field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.field-checkbox input {
  width: auto;
}

.editor-table input,
.editor-table select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}

.editor-table td {
  vertical-align: top;
}

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

.btn-danger {
  background: #fdecea;
  color: #8a1f11;
  border-color: #f5c4be;
}

.btn-danger:hover {
  background: #f8d5d0;
}

.btn-secondary {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.totals-strip {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #faf8f5;
  border: 1px solid var(--border);
}

.totals-strip .detail-row {
  margin: 0;
  padding-bottom: 8px;
}

.totals-strip .detail-row:last-child {
  border-bottom: none;
  font-weight: 800;
}

.send-actions {
  display: grid;
  gap: 10px;
}

.send-link-box {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.send-link-box input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(26, 26, 26, 0.2);
}

.toast[hidden] {
  display: none;
}

.inline-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.data-table .no-click {
  cursor: default;
}

.data-table .no-click:hover {
  background: transparent;
}
