/* ═══════════════════════════════════════════════════════════════════════════
   portal.forense.io — Apple-Inspired Design System
   a ness. company · Plataforma de Inteligência Corporativa

   Every pixel matters. Clean. Spacious. Sophisticated.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ─── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Surface hierarchy — darkest to lightest */
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #12121a;
  --bg-tertiary:   #1a1a26;
  --bg-hover:      #1e1e2e;
  --bg-active:     #252538;

  /* Accent — the single point of color energy */
  --accent:        #00ade8;
  --accent-hover:  #33c0ee;
  --accent-dim:    #0090c0;
  --accent-bg:     rgba(0, 173, 232, 0.06);
  --accent-bg-hover: rgba(0, 173, 232, 0.10);
  --accent-border: rgba(0, 173, 232, 0.18);
  --accent-glow:   rgba(0, 173, 232, 0.12);

  /* Text hierarchy — bright to dim */
  --text-primary:   #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
  --text-dim:       #475569;

  /* Borders — nearly invisible layering */
  --border:        rgba(255, 255, 255, 0.06);
  --border-hover:  rgba(255, 255, 255, 0.12);
  --border-focus:  rgba(0, 173, 232, 0.40);

  /* Semantic — muted jewel tones */
  --success:       #34D399;
  --success-bg:    rgba(52, 211, 153, 0.10);
  --warning:       #FBBF24;
  --warning-bg:    rgba(251, 191, 36, 0.10);
  --danger:        #F87171;
  --danger-bg:     rgba(248, 113, 113, 0.10);
  --info:          #00ade8;
  --purple:        #A78BFA;
  --purple-bg:     rgba(167, 139, 250, 0.10);
  --orange:        #FB923C;

  /* Typography */
  --font-primary:  'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Spacing — 8px grid, strictly */
  --space-2:   2px;
  --space-4:   4px;
  --space-6:   6px;
  --space-8:   8px;
  --space-12:  12px;
  --space-16:  16px;
  --space-20:  20px;
  --space-24:  24px;
  --space-32:  32px;
  --space-40:  40px;
  --space-48:  48px;
  --space-56:  56px;
  --space-64:  64px;

  /* Radii — generous, Apple-like */
  --radius-xs:   6px;
  --radius-sm:   8px;
  --radius-md:   10px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  20px;
  --radius-full: 9999px;

  /* Motion — natural, not robotic */
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:  cubic-bezier(0.0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration:     200ms;
  --duration-slow: 300ms;
  --duration-enter: 400ms;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
}


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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: var(--font-primary);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font-family: var(--font-primary);
  font-size: 14px;
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: rgba(0, 173, 232, 0.30);
  color: var(--text-primary);
}


/* ─── Scrollbar — thin, quiet ───────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.3) transparent;
}


/* ─── Typography Scale ──────────────────────────────────────────────────── */
h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
}

.code {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13px;
  color: var(--text-secondary);
}


/* ─── Layout Structure ──────────────────────────────────────────────────── *
 *
 *  ┌──────────────┬─────────────────────────────────┐
 *  │  SIDEBAR     │         HEADER BAR              │  ← both 64px
 *  │  BRAND       │  Page Title       User Info     │
 *  ├──────────────┼─────────────────────────────────┤
 *  │  NAV LINKS   │                                 │
 *  │  Dashboard   │      PAGE CONTENT               │
 *  │  Projetos    │                                 │
 *  │  ...         │                                 │
 *  └──────────────┴─────────────────────────────────┘
 */
.app-layout {
  display: flex;
  min-height: 100vh;
}


/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Brand area — perfectly aligned with header height */
.sidebar-brand {
  display: flex;
  align-items: center;
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 var(--space-24);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand .header-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}

/* Navigation area — scrollable */
.sidebar-nav-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-16) 0;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 var(--space-12);
}

.sidebar-section {
  padding: var(--space-24) var(--space-12) var(--space-8);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.sidebar-section:first-child {
  padding-top: var(--space-8);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  position: relative;
}

.nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-link.active .nav-icon {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}

/* Sidebar footer */
.sidebar-footer {
  padding: var(--space-16) var(--space-24);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}


/* ─── Header ────────────────────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-32);
  background: rgba(10, 10, 15, 0.80);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 20px;
  transition: all var(--duration) var(--ease);
}

.hamburger:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Logo */
.logo {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 22px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  user-select: none;
}

.logo .dot {
  color: var(--accent);
}

.logo-sub {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  user-select: none;
}

.logo-sub .ness {
  color: var(--text-primary);
  font-weight: 500;
}

.logo-sub .ness .dot {
  color: var(--accent);
}

.header-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  cursor: pointer;
}

/* Header right area */
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

/* User Profile Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-20);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
  transition: all var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  text-align: left;
}

.user-dropdown.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Specific anchoring when in sidebar user card (floats above it) */
.sidebar-user-card .user-dropdown {
  bottom: calc(100% + 12px);
  top: auto;
  left: 0;
  right: 0;
  width: auto;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(-8px) scale(0.96);
}

.sidebar-user-card .user-dropdown.visible {
  transform: translateY(0) scale(1);
}

.dropdown-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-8);
}

.dropdown-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.dropdown-field label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.dropdown-value {
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
}

.dropdown-actions {
  margin-top: var(--space-8);
}

/* Sidebar User Card */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin: 0 var(--space-16) var(--space-16) var(--space-16);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  position: relative;
  user-select: none;
}

.sidebar-user-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.sidebar-user-card .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-card .user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.sidebar-user-card .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-card .user-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-card .user-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* Sidebar Footer Links */
.sidebar-footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-12) var(--space-20);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
  cursor: pointer;
}

.sidebar-footer-link:hover {
  color: var(--text-primary);
}

.sidebar-footer-link svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease);
}

.sidebar-footer-link:hover svg {
  color: var(--text-primary);
}

/* Page Content Header */
.page-content-header {
  margin-bottom: var(--space-32);
}

.page-content-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-12);
  display: flex;
  align-items: center;
}

.page-greeting {
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-16);
  margin-bottom: var(--space-8);
}

.btn-header {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}

.btn-header:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-header.admin-link {
  color: var(--accent);
}

.btn-header.admin-link:hover {
  background: var(--accent-bg);
}


/* ─── Content Area ──────────────────────────────────────────────────────── */
/* Fluid Content Wrapper starting below header on desktop */
.content-wrapper {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  flex: 1;
  display: flex;
  justify-content: flex-start;
  min-height: calc(100vh - var(--header-height));
  min-width: 0;
}

.content {
  padding: var(--space-40) var(--space-48);
  max-width: 100%;
  width: 100%;
  min-height: 100%;
  animation: fadeIn var(--duration-slow) var(--ease);
  box-sizing: border-box;
}

/* Dashboard Layout Grid to match b.standard */
.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-24);
  margin-top: var(--space-8);
  align-items: start;
}

@media (max-width: 1024px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
}

.action-card {
  transition: all var(--duration) var(--ease);
}

.action-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover) !important;
  transform: translateY(-1px);
}

/* Stat card layout styling */
.stat-card-new {
  padding: var(--space-20);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
}

.stat-card-new .stat-icon-wrapper {
  color: var(--text-muted);
  opacity: 0.65;
  padding: var(--space-6);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}


/* ─── Glass Card ────────────────────────────────────────────────────────── */
.glass {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  transition: border-color var(--duration) var(--ease);
}

.glass:hover {
  border-color: var(--border-hover);
}


/* ─── Project Cards ─────────────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--space-24);
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-24);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
  animation: fadeInUp var(--duration-slow) var(--ease) backwards;
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-16);
}

.project-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.project-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: var(--space-4);
}

.project-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  line-height: 1.4;
}

.project-client {
  font-size: 13px;
  color: var(--text-secondary);
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-24);
  padding-top: var(--space-16);
  border-top: 1px solid var(--border);
}

.project-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.project-counts {
  display: flex;
  gap: var(--space-16);
  font-size: 12px;
  color: var(--text-secondary);
}

.project-counts span {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Stagger animation — subtle cascade */
.project-card:nth-child(1)  { animation-delay: 0ms; }
.project-card:nth-child(2)  { animation-delay: 50ms; }
.project-card:nth-child(3)  { animation-delay: 100ms; }
.project-card:nth-child(4)  { animation-delay: 150ms; }
.project-card:nth-child(5)  { animation-delay: 200ms; }
.project-card:nth-child(6)  { animation-delay: 250ms; }
.project-card:nth-child(7)  { animation-delay: 300ms; }
.project-card:nth-child(8)  { animation-delay: 350ms; }
.project-card:nth-child(9)  { animation-delay: 400ms; }


/* ─── Status Badges — pill-shaped, subtle ───────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.4;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Badge variants */
.badge-em_andamento {
  background: rgba(0, 173, 232, 0.10);
  color: var(--accent);
}
.badge-em_andamento::before {
  background: var(--accent);
}

.badge-entregue {
  background: var(--success-bg);
  color: var(--success);
}
.badge-entregue::before {
  background: var(--success);
}

.badge-proposta {
  background: var(--warning-bg);
  color: var(--warning);
}
.badge-proposta::before {
  background: var(--warning);
}

.badge-arquivado {
  background: rgba(100, 116, 139, 0.10);
  color: var(--text-muted);
}
.badge-arquivado::before {
  background: var(--text-muted);
}

.badge-risco_alto {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-risco_alto::before {
  background: var(--danger);
}

.badge-pendente {
  background: var(--warning-bg);
  color: var(--warning);
}
.badge-pendente::before {
  background: var(--warning);
}

.badge-confirmado,
.badge-ativo {
  background: var(--success-bg);
  color: var(--success);
}
.badge-confirmado::before,
.badge-ativo::before {
  background: var(--success);
}

.badge-inativo {
  background: rgba(100, 116, 139, 0.10);
  color: var(--text-muted);
}
.badge-inativo::before {
  background: var(--text-muted);
}

.badge-rejeitado {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-rejeitado::before {
  background: var(--danger);
}


/* ─── Tables — clean, no zebra ──────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table thead {
  background: transparent;
}

.table th {
  padding: var(--space-16) var(--space-20);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: var(--space-16) var(--space-20);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

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

.table tbody tr {
  transition: background var(--duration) var(--ease);
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

.table td.primary {
  color: var(--text-primary);
  font-weight: 500;
}

.table td.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.table .actions {
  display: flex;
  gap: var(--space-8);
}


/* ─── Buttons — generous padding, smooth feel ───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 14px var(--space-24);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.25);
}

.btn-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: var(--space-8) var(--space-12);
  border: none;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.btn-sm {
  padding: var(--space-8) var(--space-16);
  font-size: 13px;
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  font-size: 16px;
}


/* ─── Forms / Inputs ────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-24);
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  padding: 14px var(--space-16);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--duration) var(--ease);
}

.form-input:hover {
  border-color: var(--border-hover);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: var(--space-6);
}

.form-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: var(--space-6);
}


/* ─── Upload Zone ───────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-xl);
  padding: var(--space-32);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  background: transparent;
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.upload-zone.dragover {
  transform: scale(1.005);
  border-color: var(--accent);
}

.upload-zone-icon {
  font-size: 40px;
  margin-bottom: var(--space-12);
  display: block;
  opacity: 0.6;
  color: var(--text-muted);
}

.upload-zone-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.upload-zone-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Progress */
.upload-progress {
  margin-top: var(--space-16);
}

.progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: var(--radius-full);
  transition: width var(--duration) var(--ease);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  animation: progressShine 2s var(--ease) infinite;
}

.progress-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-8);
  text-align: right;
}


/* ─── File List ─────────────────────────────────────────────────────────── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin-top: var(--space-16);
}

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--duration) var(--ease);
}

.file-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.file-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-bg);
  border-radius: var(--radius-md);
  color: var(--accent);
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  gap: var(--space-12);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.file-meta .mono {
  font-size: 12px;
}

.file-actions {
  display: flex;
  gap: var(--space-4);
  flex-shrink: 0;
}


/* ─── Timeline ──────────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: var(--space-32);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: var(--space-8);
  bottom: var(--space-8);
  width: 2px;
  background: var(--border-hover);
  border-radius: var(--radius-full);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-32);
  animation: fadeInUp var(--duration-slow) var(--ease) backwards;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-32) + 6px);
  top: var(--space-4);
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: 3px solid var(--bg-primary);
  z-index: 1;
}

.timeline-item:not(:first-child) .timeline-dot {
  background: var(--bg-tertiary);
  border-color: var(--bg-primary);
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.timeline-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.timeline-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Timeline stagger */
.timeline-item:nth-child(1) { animation-delay: 0ms; }
.timeline-item:nth-child(2) { animation-delay: 60ms; }
.timeline-item:nth-child(3) { animation-delay: 120ms; }
.timeline-item:nth-child(4) { animation-delay: 180ms; }
.timeline-item:nth-child(5) { animation-delay: 240ms; }
.timeline-item:nth-child(6) { animation-delay: 300ms; }


/* ─── Modal / Dialog ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-24);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
  pointer-events: none;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.96) translateY(8px);
  transition: transform var(--duration-slow) var(--ease-spring);
}

.modal-overlay.visible .modal {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 18px;
  transition: all var(--duration) var(--ease);
}

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

.modal-body {
  padding: var(--space-24);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-24);
  border-top: 1px solid var(--border);
}


/* ─── Toast Notifications — bottom-right, refined ───────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-32);
  right: var(--space-32);
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-8);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-20);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  animation: toastIn var(--duration-slow) var(--ease-spring);
  pointer-events: auto;
  max-width: 400px;
}

.toast.removing {
  animation: toastOut var(--duration) var(--ease) forwards;
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast-info {
  border-left: 3px solid var(--accent);
}


/* ─── Loading Spinner ───────────────────────────────────────────────────── */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-64);
  gap: var(--space-16);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

.loading-text {
  font-size: 13px;
  color: var(--text-muted);
}


/* ─── Empty State ───────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-64) var(--space-32);
  text-align: center;
}

.empty-icon {
  margin-bottom: var(--space-12);
  opacity: 0.3;
  color: var(--text-muted);
  /* Reserve 120px area */
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon svg {
  width: 56px;
  height: 56px;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.empty-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}


/* ─── Stats Cards ───────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-16);
  margin-bottom: var(--space-32);
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-24);
  transition: all var(--duration) var(--ease);
  animation: fadeInUp var(--duration-slow) var(--ease) backwards;
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 60ms; }
.stat-card:nth-child(3) { animation-delay: 120ms; }
.stat-card:nth-child(4) { animation-delay: 180ms; }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-12);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
}

.stat-icon {
  float: right;
  font-size: 24px;
  opacity: 0.25;
  color: var(--text-muted);
}


/* ─── Tab Bar ───────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-32);
}

.tab-item {
  padding: var(--space-16) var(--space-24);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  background: none;
  margin-bottom: -1px;
}

.tab-item:hover {
  color: var(--text-primary);
}

.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}


/* ─── Page Headers ──────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-32);
  flex-wrap: wrap;
  gap: var(--space-16);
}

.page-header-left h1 {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  flex-wrap: wrap;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: var(--space-4);
}

.welcome-text {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.welcome-sub {
  font-size: 14px;
  color: var(--text-secondary);
}


/* ─── Deliverables ──────────────────────────────────────────────────────── */
.deliverables-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.deliverable-item {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16) var(--space-20);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--duration) var(--ease);
}

.deliverable-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.deliverable-icon {
  font-size: 24px;
  flex-shrink: 0;
  opacity: 0.7;
}

.deliverable-info {
  flex: 1;
}

.deliverable-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.deliverable-type {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--space-2);
}


/* ─── Activity List ─────────────────────────────────────────────────────── */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-16) 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 7px;
}

.activity-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.activity-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: var(--space-4);
}


/* ─── Section Titles ────────────────────────────────────────────────────── */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-20);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}


/* ─── Divider ───────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-32) 0;
}


/* ─── Login Screen ──────────────────────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: var(--space-24);
}

#login-screen .login-wrapper {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

#login-screen .login-logo {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 2.4rem;
  color: var(--text-primary);
  margin-bottom: var(--space-8);
}

#login-screen .login-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-32);
}

#login-screen .login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-32);
  text-align: center;
}

#login-screen .login-card h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-8);
}

#login-screen .login-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-24);
}

#login-screen input[type="email"] {
  width: 100%;
  padding: 14px var(--space-16);
  font-family: var(--font-primary);
  font-size: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration) var(--ease);
}

#login-screen input[type="email"]:focus {
  border-color: var(--accent);
}

#login-screen input[type="email"]::placeholder {
  color: var(--text-dim);
}

#login-screen button[type="submit"] {
  width: 100%;
  padding: 14px;
  margin-top: var(--space-16);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

#login-screen button[type="submit"]:hover {
  background: var(--accent-hover);
}

#login-screen button[type="submit"]:active {
  transform: scale(0.98);
}

#login-screen .login-footer {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: var(--space-24);
}

/* Login shake animation (on error) */
.shake {
  animation: shake 0.5s var(--ease);
}


/* ─── Animations ────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes progressShine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


/* ─── Print ─────────────────────────────────────────────────────────────── */
@media print {
  body {
    background: #fff;
    color: #1f2937;
    font-size: 12px;
  }

  @page {
    size: A4;
    margin: 18mm 15mm 22mm 15mm;
  }

  .sidebar,
  .header,
  .btn,
  .upload-zone,
  nav,
  .hamburger,
  #toast-container,
  .modal-overlay,
  .tab-bar,
  .btn-header,
  .sidebar-brand,
  .sidebar-footer {
    display: none !important;
  }

  .content {
    margin-left: 0;
    margin-top: 0;
    padding: 0;
    max-width: none;
  }

  .app-layout {
    display: block;
  }

  .glass,
  .project-card,
  .stat-card,
  .file-item,
  .deliverable-item {
    background: #fff;
    backdrop-filter: none;
    border: 1px solid #e5e7eb;
    box-shadow: none;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  h1, h2, h3 {
    page-break-after: avoid;
    color: #111827;
  }

  table {
    page-break-inside: auto;
  }

  thead {
    display: table-header-group;
  }

  td {
    white-space: normal !important;
  }

  .badge {
    border: 1px solid currentColor;
  }

  .table td,
  .table th {
    color: #374151;
  }
}


/* ─── Responsive — Tablet ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease);
    z-index: 100;
    background: var(--bg-secondary);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-slow) var(--ease);
  }

  .sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .hamburger {
    display: flex;
  }

  .header {
    left: 0;
    display: flex;
  }

  .content-wrapper {
    margin-left: 0;
    margin-top: var(--header-height);
    width: 100%;
    min-height: calc(100vh - var(--header-height));
  }

  .content {
    padding: var(--space-24);
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}


/* ─── Responsive — Mobile ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .content {
    padding: var(--space-16);
  }

  .header {
    padding: 0 var(--space-16);
  }

  .user-meta {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .table-container {
    border-radius: var(--radius-lg);
  }

  .welcome-text {
    font-size: 22px;
  }

  h1 {
    font-size: 22px;
  }

  .tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-item {
    white-space: nowrap;
    padding: var(--space-12) var(--space-16);
    font-size: 13px;
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-xl);
  }

  .project-grid {
    gap: var(--space-16);
  }

  #toast-container {
    left: var(--space-16);
    right: var(--space-16);
    bottom: var(--space-16);
  }

  .toast {
    max-width: 100%;
  }
}


/* ─── Reduced Motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ─── Utility Classes ───────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Text colors */
.text-accent    { color: var(--accent); }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-warning   { color: var(--warning); }

/* Spacing utilities */
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: var(--space-8); }
.mt-16 { margin-top: var(--space-16); }
.mt-24 { margin-top: var(--space-24); }
.mt-32 { margin-top: var(--space-32); }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: var(--space-8); }
.mb-16 { margin-bottom: var(--space-16); }
.mb-24 { margin-bottom: var(--space-24); }

/* Flex helpers */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-gap-8  { gap: var(--space-8); }
.flex-gap-16 { gap: var(--space-16); }

/* Truncate */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
