/* ══════════════════════════════════════════════════════════
   tc-core.css — Tee Commerce Design System
   Shared across all tools · No build step required
   ══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Brand Tokens ──────────────────────────────────────── */
:root {
  /* Palette */
  --tc-bg: #fffcf9;
  --tc-bg-card: #ffffff;
  --tc-bg-subtle: #f7f5f2;
  --tc-text: #1a2e1a;
  --tc-text-secondary: #3d5a3d;
  --tc-text-muted: #6b7f6b;
  --tc-accent: #cbef44;
  --tc-accent-hover: #b8dc2e;
  --tc-accent-text: #1a2e1a;
  --tc-border: #aec3b0;
  --tc-border-light: #d4e2d5;
  --tc-focus-ring: rgba(174, 195, 176, 0.4);

  /* Spacing */
  --tc-space-xs: 8px;
  --tc-space-sm: 12px;
  --tc-space-md: 16px;
  --tc-space-lg: 24px;
  --tc-space-xl: 32px;

  /* Radius */
  --tc-radius: 12px;
  --tc-radius-sm: 8px;
  --tc-radius-xs: 6px;

  /* Shadows (warm greenish tint) */
  --tc-shadow-sm: 0 1px 3px rgba(26, 46, 26, 0.06);
  --tc-shadow-md: 0 4px 12px rgba(26, 46, 26, 0.08);
  --tc-shadow-lg: 0 8px 24px rgba(26, 46, 26, 0.10);
  --tc-shadow-xl: 0 20px 60px rgba(26, 46, 26, 0.16);

  /* Transitions */
  --tc-transition: 0.15s ease;
  --tc-transition-slow: 0.2s ease;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base Typography ───────────────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--tc-bg);
  color: var(--tc-text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--tc-text);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 22px; letter-spacing: -0.3px; }
h2 { font-size: 20px; letter-spacing: -0.3px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

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

code, .mono {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

/* ── Layout Utilities ──────────────────────────────────── */
.tc-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--tc-space-lg);
}

.tc-flex { display: flex; align-items: center; }
.tc-flex-col { display: flex; flex-direction: column; }
.tc-flex-between { display: flex; align-items: center; justify-content: space-between; }
.tc-flex-center { display: flex; align-items: center; justify-content: center; }
.tc-flex-wrap { flex-wrap: wrap; }

.tc-gap-xs { gap: var(--tc-space-xs); }
.tc-gap-sm { gap: var(--tc-space-sm); }
.tc-gap-md { gap: var(--tc-space-md); }
.tc-gap-lg { gap: var(--tc-space-lg); }

.tc-grid { display: grid; }

/* ── App Header ────────────────────────────────────────── */
.app-header {
  background: var(--tc-bg-card);
  border-bottom: 1px solid var(--tc-border-light);
  padding: var(--tc-space-md) var(--tc-space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.app-header h1,
.app-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--tc-text);
  letter-spacing: -0.3px;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--tc-radius-sm);
  padding: var(--tc-space-xs) var(--tc-space-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tc-transition);
  text-decoration: none;
  color: var(--tc-text);
  background: var(--tc-bg-subtle);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover { background: var(--tc-border-light); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--tc-accent);
  color: var(--tc-accent-text);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--tc-accent-hover); }

.btn-outline {
  background: var(--tc-bg-card);
  color: var(--tc-text);
  border: 1px solid var(--tc-border);
}
.btn-outline:hover {
  border-color: var(--tc-text);
  background: var(--tc-bg-subtle);
}

.btn-secondary {
  background: var(--tc-bg-subtle);
  color: var(--tc-text);
  border: 1px solid var(--tc-border-light);
}
.btn-secondary:hover:not(:disabled) { background: var(--tc-border-light); }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--tc-radius-xs);
}

.btn-icon {
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
  background: var(--tc-bg-subtle);
  border: 1px solid var(--tc-border-light);
  border-radius: var(--tc-radius-xs);
  cursor: pointer;
  transition: all var(--tc-transition);
}
.btn-icon:hover { background: var(--tc-border-light); }
.btn-icon.active {
  background: var(--tc-accent);
  border-color: var(--tc-accent);
  color: var(--tc-accent-text);
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--tc-bg-card);
  border-radius: var(--tc-radius);
  border: 1px solid var(--tc-border-light);
  overflow: hidden;
  transition: transform var(--tc-transition), box-shadow var(--tc-transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--tc-shadow-lg);
}

.card--flat,
.card--flat:hover {
  transform: none;
  box-shadow: none;
}

/* ── Modals ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 46, 26, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--tc-bg-card);
  border-radius: var(--tc-radius);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--tc-shadow-xl);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--tc-space-lg);
  border-bottom: 1px solid var(--tc-border-light);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--tc-text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--tc-text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--tc-radius-sm);
  transition: all var(--tc-transition);
}

.modal-close:hover {
  background: var(--tc-bg-subtle);
  color: var(--tc-text);
}

/* ── Form Inputs ───────────────────────────────────────── */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--tc-text);
  background: var(--tc-bg-card);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-sm);
  padding: var(--tc-space-xs) 12px;
  outline: none;
  transition: border-color var(--tc-transition-slow), box-shadow var(--tc-transition-slow);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--tc-text-secondary);
  box-shadow: 0 0 0 3px var(--tc-focus-ring);
}

input::placeholder,
textarea::placeholder {
  color: var(--tc-text-muted);
}

input:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.search-input {
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-sm);
  padding: var(--tc-space-xs) 14px;
  font-size: 14px;
  width: 260px;
  max-width: 100%;
  outline: none;
  transition: border-color var(--tc-transition-slow), box-shadow var(--tc-transition-slow);
}

.search-input:focus {
  border-color: var(--tc-text-secondary);
  box-shadow: 0 0 0 3px var(--tc-focus-ring);
}

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #ffedd5; color: #ea580c; }
.badge-danger  { background: #fee2e2; color: #dc2626; }
.badge-neutral { background: var(--tc-bg-subtle); color: var(--tc-text-secondary); }

/* ── Toolbar ───────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tc-space-md);
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  background: var(--tc-bg-subtle);
  border-radius: 10px;
  padding: 4px;
}

.view-btn {
  background: transparent;
  border: none;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--tc-text-muted);
  display: flex;
  align-items: center;
  border-radius: var(--tc-radius-sm);
  transition: all var(--tc-transition-slow);
}

.view-btn.active {
  background: var(--tc-accent);
  color: var(--tc-accent-text);
  box-shadow: var(--tc-shadow-sm);
}

.view-btn:hover:not(.active) {
  color: var(--tc-text);
}

/* ── Spinner & Loading ─────────────────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--tc-border-light);
  border-top-color: var(--tc-text-secondary);
  border-radius: 50%;
  animation: tc-spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

@keyframes tc-spin { to { transform: rotate(360deg); } }

/* ── Skeleton Loader ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--tc-bg-subtle) 25%,
    var(--tc-border-light) 50%,
    var(--tc-bg-subtle) 75%
  );
  background-size: 200% 100%;
  animation: tc-skeleton 1.5s ease infinite;
  border-radius: var(--tc-radius-xs);
}

@keyframes tc-skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  padding: 40px;
  text-align: center;
  color: var(--tc-text-muted);
}

.empty-state h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--tc-text);
  margin-bottom: var(--tc-space-xs);
}

.empty-state p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--tc-text-secondary);
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--tc-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--tc-text-muted); }

/* ── Responsive Utilities ──────────────────────────────── */
.tc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

@media (max-width: 768px) {
  .tc-hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
  .tc-hide-desktop { display: none !important; }
}
