/*
 * Tuzzello UI foundation
 * Shared design tokens and reusable component classes for the logged-in
 * marketplace platform. Existing screens can adopt these classes gradually.
 */

:root {
  --tz-primary: #47767e;
  --tz-primary-dark: #123f46;
  --tz-primary-deep: #073039;
  --tz-primary-soft: rgba(71, 118, 126, 0.12);
  --tz-primary-line: rgba(71, 118, 126, 0.24);
  --tz-accent: #f35b04;
  --tz-accent-dark: #c94903;
  --tz-accent-soft: rgba(243, 91, 4, 0.12);
  --tz-bg: #edf6f9;
  --tz-surface: #ffffff;
  --tz-surface-alt: #f7fafb;
  --tz-text: #424242;
  --tz-text-strong: #16272b;
  --tz-text-muted: #6b7a80;
  --tz-dashboard-title: #c7f0e4;
  --tz-border: #d9e6e9;
  --tz-border-strong: rgba(71, 118, 126, 0.38);
  --tz-success: #15803d;
  --tz-success-soft: #e8f7ee;
  --tz-warning: #b7791f;
  --tz-warning-soft: #fff7e6;
  --tz-danger: #d93025;
  --tz-danger-soft: #fdeceb;
  --tz-info: #2563eb;
  --tz-info-soft: #eaf1ff;
  --tz-font: Poppins, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tz-radius-xs: 4px;
  --tz-radius-sm: 6px;
  --tz-radius: 8px;
  --tz-radius-lg: 12px;
  --tz-shadow-sm: 0 1px 2px rgba(18, 63, 70, 0.08);
  --tz-shadow: 0 8px 20px rgba(18, 63, 70, 0.10);
  --tz-shadow-lg: 0 18px 42px rgba(18, 63, 70, 0.16);
  --tz-focus-ring: 0 0 0 3px rgba(243, 91, 4, 0.24);
  --tz-topbar-height: 64px;
  --tz-sidebar-width: 248px;
  --tz-space-1: 4px;
  --tz-space-2: 8px;
  --tz-space-3: 12px;
  --tz-space-4: 16px;
  --tz-space-5: 20px;
  --tz-space-6: 24px;
  --tz-space-8: 32px;
}

body.dark-theme {
  --tz-bg: #172125;
  --tz-surface: #202c31;
  --tz-surface-alt: #26343a;
  --tz-text: #dbe8eb;
  --tz-text-strong: #ffffff;
  --tz-text-muted: #a9bbc0;
  --tz-border: rgba(255, 255, 255, 0.12);
  --tz-border-strong: rgba(255, 255, 255, 0.22);
  --tz-primary-soft: rgba(71, 118, 126, 0.28);
  --tz-accent-soft: rgba(243, 91, 4, 0.18);
  --tz-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --tz-shadow: 0 8px 22px rgba(0, 0, 0, 0.26);
  --tz-shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.36);
}

.tz-app,
.tz-card,
.tz-panel,
.tz-table,
.tz-btn,
.tz-form-control,
.tz-select,
.tz-badge,
.tz-modal {
  font-family: var(--tz-font);
}

.tz-app {
  background: var(--tz-bg);
  color: var(--tz-text);
}

.tz-page-header {
  align-items: flex-start;
  display: flex;
  gap: var(--tz-space-4);
  justify-content: space-between;
  margin-bottom: var(--tz-space-6);
}

.tz-page-title {
  color: var(--tz-text-strong);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

.tz-page-subtitle {
  color: var(--tz-text-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: var(--tz-space-2) 0 0;
}

.tz-card,
.tz-panel {
  background: var(--tz-surface);
  border: 1px solid var(--tz-border);
  border-radius: var(--tz-radius);
  box-shadow: var(--tz-shadow-sm);
  color: var(--tz-text);
}

.tz-card {
  padding: var(--tz-space-5);
}

.tz-panel {
  padding: var(--tz-space-6);
}

.tz-stat-grid {
  display: grid;
  gap: var(--tz-space-4);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.tz-stat-card {
  background: var(--tz-surface);
  border: 1px solid var(--tz-border);
  border-radius: var(--tz-radius);
  box-shadow: var(--tz-shadow-sm);
  padding: var(--tz-space-5);
}

.tz-stat-label {
  color: var(--tz-text-muted);
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 var(--tz-space-2);
}

.tz-stat-value {
  color: var(--tz-text-strong);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

.tz-stat-trend {
  align-items: center;
  color: var(--tz-success);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: var(--tz-space-1);
  margin-top: var(--tz-space-2);
}

.tz-filterbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--tz-space-3);
  margin-bottom: var(--tz-space-5);
}

.tz-form-control,
.tz-select {
  background: var(--tz-surface);
  border: 1px solid var(--tz-border);
  border-radius: var(--tz-radius-sm);
  color: var(--tz-text);
  font-size: 13px;
  min-height: 38px;
  padding: 8px 11px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tz-form-control:focus,
.tz-select:focus {
  border-color: var(--tz-accent);
  box-shadow: var(--tz-focus-ring);
  outline: 0;
}

.tz-btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--tz-radius-sm);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: var(--tz-space-2);
  justify-content: center;
  line-height: 1.2;
  min-height: 38px;
  padding: 9px 14px;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.tz-btn:focus-visible {
  box-shadow: var(--tz-focus-ring);
  outline: 0;
}

.tz-btn-primary {
  background: var(--tz-primary);
  color: #ffffff;
}

.tz-btn-primary:hover {
  background: var(--tz-primary-dark);
  color: #ffffff;
}

.tz-btn-accent {
  background: var(--tz-accent);
  color: #ffffff;
}

.tz-btn-accent:hover {
  background: var(--tz-accent-dark);
  color: #ffffff;
}

.tz-btn-outline {
  background: var(--tz-surface);
  border-color: var(--tz-border-strong);
  color: var(--tz-primary);
}

.tz-btn-outline:hover {
  background: var(--tz-primary-soft);
  color: var(--tz-primary-dark);
}

.tz-btn-danger {
  background: var(--tz-danger);
  color: #ffffff;
}

.tz-btn-danger:hover {
  background: #b42318;
  color: #ffffff;
}

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

.tz-table {
  background: var(--tz-surface);
  border-collapse: separate;
  border-spacing: 0;
  color: var(--tz-text);
  font-size: 13px;
  width: 100%;
}

.tz-table th {
  background: var(--tz-primary);
  color: #ffffff;
  font-weight: 700;
  padding: 11px 12px;
  text-align: left;
}

.tz-table td {
  border-bottom: 1px solid var(--tz-border);
  padding: 11px 12px;
  vertical-align: middle;
}

.tz-table tbody tr:hover td {
  background: var(--tz-surface-alt);
}

.tz-badge {
  align-items: center;
  border-radius: var(--tz-radius-xs);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  min-height: 22px;
  padding: 5px 8px;
}

.tz-badge-success {
  background: var(--tz-success-soft);
  color: var(--tz-success);
}

.tz-badge-warning {
  background: var(--tz-warning-soft);
  color: var(--tz-warning);
}

.tz-badge-danger {
  background: var(--tz-danger-soft);
  color: var(--tz-danger);
}

.tz-badge-info {
  background: var(--tz-info-soft);
  color: var(--tz-info);
}

.tz-badge-accent {
  background: var(--tz-accent-soft);
  color: var(--tz-accent);
}

.tz-pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--tz-space-2);
  justify-content: center;
  margin-top: var(--tz-space-5);
}

.tz-page-link {
  background: var(--tz-surface);
  border: 1px solid var(--tz-border-strong);
  border-radius: var(--tz-radius-xs);
  color: var(--tz-primary);
  font-size: 13px;
  line-height: 1.2;
  min-width: 32px;
  padding: 7px 10px;
  text-align: center;
  text-decoration: none;
}

.tz-page-link:hover,
.tz-page-link.is-active {
  background: var(--tz-primary);
  color: #ffffff;
}

.tz-page-link.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.tz-modal-backdrop {
  align-items: center;
  background: rgba(7, 48, 57, 0.58);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: var(--tz-space-5);
  position: fixed;
  z-index: 1000000;
}

.tz-modal {
  background: var(--tz-surface);
  border: 1px solid var(--tz-border);
  border-radius: var(--tz-radius);
  box-shadow: var(--tz-shadow-lg);
  color: var(--tz-text);
  max-width: calc(100vw - 40px);
  padding: var(--tz-space-6);
  width: 520px;
}

.tz-toast {
  align-items: flex-start;
  background: var(--tz-surface);
  border: 1px solid var(--tz-border);
  border-left: 4px solid var(--tz-primary);
  border-radius: var(--tz-radius);
  box-shadow: var(--tz-shadow);
  color: var(--tz-text);
  display: flex;
  font-family: var(--tz-font);
  font-size: 13px;
  gap: var(--tz-space-3);
  max-width: 340px;
  padding: var(--tz-space-4);
}

.tz-toast-success {
  border-left-color: var(--tz-success);
}

.tz-toast-error {
  border-left-color: var(--tz-danger);
}

.tz-toast-warning {
  border-left-color: var(--tz-warning);
}

.tz-icon-btn {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--tz-radius-sm);
  color: var(--tz-text-muted);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  padding: 0;
  width: 36px;
}

.tz-icon-btn:hover {
  background: var(--tz-primary-soft);
  color: var(--tz-primary);
}

@media (max-width: 900px) {
  .tz-page-header {
    flex-direction: column;
  }

  .tz-page-title {
    font-size: 24px;
  }

  .tz-panel,
  .tz-card,
  .tz-stat-card {
    padding: var(--tz-space-4);
  }
}
