/* ===== GLOBAL STYLES - QUIET COMMAND CENTER ===== */
/*
 * Shared component contract:
 * .page-header aligns page-level controls; .page-title styles an existing heading.
 * .empty-state provides the standard no-results layout; .timestamp-natural marks metadata.
 * Feature work surfaces remain in their owning stylesheet.
 */

/* ===== CSS RESET & BASE ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.has-workbench {
  min-width: calc(1280px - (100vw - 100%));
  padding-left: var(--sidebar-width);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 650;
}

h1 {
  font-size: var(--text-xl);
}

h2,
h3 {
  font-size: var(--text-lg);
}

h4,
h5,
h6 {
  font-size: var(--text-base);
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-surface);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
  transition: background var(--duration-fast) var(--ease-default);
}

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

/* ===== FOCUS STATES ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

/* ===== SHARED ANIMATIONS ===== */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== UTILITY CLASSES ===== */
.modern-desktop {
  width: 100%;
}

.app-content {
  min-height: 100vh;
  padding: calc(var(--topbar-height) + var(--space-4)) var(--space-5) var(--space-5);
}

.app-content.container-fluid {
  max-width: none;
}

[class*="stat-number"] {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.table {
  font-variant-numeric: tabular-nums;
}

.table [data-value],
.timestamp-natural {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ===== HIDDEN UTILITY CLASSES ===== */
.delete-form-hidden {
  display: none;
}

.file-preview-hidden {
  display: none;
}

/* ===== COMPACT ACTION BARS ===== */
.page-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding: var(--space-2) 0;
  flex-wrap: wrap;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.page-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* ===== EMPTY STATES ===== */
.empty-state-enhanced {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--text-secondary);
}

.empty-state-enhanced i {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: var(--space-6);
  display: block;
  color: var(--text-muted);
}

.empty-state-enhanced h5 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.empty-state-enhanced p {
  font-size: var(--text-base);
  margin-bottom: var(--space-6);
  color: var(--text-secondary);
}

/* Standard empty state (from design system) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-8);
  text-align: center;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--text-muted);
  font-size: 2rem;
}

.empty-state p {
  max-width: 400px;
  margin-bottom: var(--space-6);
  color: var(--text-secondary);
}

.empty-state h5 {
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: var(--text-xl);
  font-weight: 600;
}

/* ===== TIMESTAMP ===== */
.timestamp-natural {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
}

/* ===== SKIP LINK (Accessibility) ===== */
.skip-link {
  position: fixed;
  top: -48px;
  left: calc(var(--sidebar-width) + var(--space-4));
  background: var(--primary);
  color: var(--text-inverse);
  padding: var(--space-2) var(--space-4);
  z-index: 10000;
  transition: top var(--duration-normal);
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  top: 0;
}

/* ===== SELECTION ===== */
::selection {
  background: var(--action);
  color: var(--text-on-action);
}
