/* ==========================================================================
   PIHU TOOLS SUITE - REFINED GLOBAL STYLES
   Clean, Professional, Non-AI Human SaaS & Print Studio Theme
   ========================================================================== */

@import url('design-system.css');

:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #ffffff;
  --wash: #f8fafc;
  --teal: #0284c7;
  --teal-dark: #0369a1;
  --teal-soft: #f0f9ff;
  --orange: #d97706;
  --orange-soft: #fffbeb;
  --violet: #4f46e5;
  --cyan: #0891b2;
  --danger: #dc2626;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --radius: 12px;
}

[data-theme="dark"] {
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: #1e293b;
  --paper: #111827;
  --wash: #090d16;
  --teal: #38bdf8;
  --teal-dark: #0284c7;
  --teal-soft: #0c4a6e;
  --orange: #f59e0b;
  --orange-soft: #78350f;
  --violet: #818cf8;
  --cyan: #22d3ee;
  --danger: #ef4444;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { min-width: 320px; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text-primary);
  background-color: var(--bg-app);
  font-family: var(--font-sans);
}

button, input, select, textarea {
  font-family: inherit;
}

button {
  touch-action: manipulation;
  cursor: pointer;
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed !important;
  opacity: 0.5 !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Unified Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.brand-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy small {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.brand-copy h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-surface-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success);
}

.offline-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

/* App Shell */
.app-shell {
  width: min(1320px, 100%);
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-surface-subtle);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
