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

:root {
  --primary: #E5311C;
  --primary-mid: #CC2A18;
  --primary-dark: #B82516;
  --sidebar-start: #E5311C;
  --sidebar-mid: #CC2A18;
  --sidebar-end: #B82516;
  --sidebar-width: 260px;
  --bg: #F3F4F7;
  --card-bg: #FFFFFF;
  --card-radius: 24px;
  --card-shadow: 0 2px 4px rgba(16,24,40,0.04), 0 12px 24px rgba(16,24,40,0.06);
  --card-hover-shadow: 0 2px 8px rgba(16,24,40,0.04), 0 16px 32px rgba(16,24,40,0.08);
  --card-border: 1px solid #E4E7EC;
  --panel-bg: #FCFCFD;
  --panel-border: 1px solid #ECEFF3;
  --input-radius: 16px;
  --input-height: 56px;
  --input-border: 1px solid #D7DEE8;
  --input-bg: linear-gradient(180deg, #FFFFFF 0%, #FCFCFD 100%);
  --input-inset-shadow: inset 0 1px 2px rgba(16,24,40,0.04), 0 1px 2px rgba(16,24,40,0.02);
  --input-hover-border: #C5CCD8;
  --input-focus-border: #E5311C;
  --input-focus-shadow: 0 0 0 4px rgba(229,49,28,0.12);
  --btn-radius: 14px;
  --btn-primary-gradient: linear-gradient(135deg, #E5311C, #C4280F);
  --btn-primary-shadow: 0 4px 14px rgba(229,49,28,0.3);
  --btn-primary-hover-shadow: 0 8px 24px rgba(229,49,28,0.4);
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-muted: #98A2B3;
  --text-light: #D1D5DB;
  --border: #E4E7EC;
  --success: #16A34A;
  --warning: #D97706;
  --error: #DC2626;
  --info: #356AE6;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-active-bg: rgba(255,255,255,0.18);
  --sidebar-active-border: rgba(255,255,255,0.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 32px; --space-2xl: 40px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration: 200ms;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
}

::selection {
  background: rgba(229,49,28,0.2);
  color: var(--text-primary);
}

/* ========== Auth Layout ========== */
.auth-body {
  background: linear-gradient(135deg, var(--sidebar-start) 0%, var(--sidebar-mid) 50%, var(--sidebar-end) 100%);
  min-height: 100vh;
}

.auth-brand-panel {
  background: linear-gradient(135deg, var(--sidebar-end) 0%, var(--sidebar-start) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand-copy {
  text-align: center;
  max-width: 420px;
}

.auth-brand-copy h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
}

.auth-card-wrapper {
  max-width: 520px;
  width: 100%;
  padding: 2rem;
}

/* ========== App Shell ========== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ========== Sidebar ========== */
.sidebar {
  width: var(--sidebar-width);
  background: #111318;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 16px rgba(0,0,0,0.2);
  transition: transform 0.3s var(--ease);
}

.sidebar {
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #E5311C; border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #EF4423; }

.sidebar-brand {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.sidebar-logo-box {
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration) var(--ease);
}

.sidebar-logo-box:hover {
  background: rgba(255,255,255,0.25);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.sidebar-logo-main {
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  line-height: 1;
  letter-spacing: -0.3px;
}

.sidebar-logo-sub {
  font-size: 0.4rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  margin: 0;
  line-height: 1.2;
}

.sidebar-brand-subtitle {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.75);
  margin: 0.2rem 0 0;
  font-weight: 500;
}

.sidebar-nav {
  list-style: none;
  padding: 1.25rem 0.75rem;
  margin: 0;
  flex: 1;
}

.sidebar-nav li { margin: 0.35rem 0; }

/* Sidebar Nav Section Headers */
.sidebar-nav-section {
  padding: 1rem 1.25rem 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.8);
}

.sidebar-nav-section:first-child {
  margin-top: 0;
  padding-top: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.9375rem 1.125rem;
  color: rgba(255,255,255,0.95);
  text-decoration: none;
  border-radius: 14px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.sidebar-nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
  background: rgba(255,255,255,0.06);
}

.sidebar-nav a:hover {
  color: white;
  transform: translateX(4px);
  padding-left: 1.5rem;
}

.sidebar-nav a:hover::before {
  opacity: 1;
}

.sidebar-nav a.active {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(255,255,255,0.08), inset 0 1px 2px rgba(255,255,255,0.1);
  transform: none;
}

.sidebar-nav a.active::before {
  opacity: 0;
}

.sidebar-nav a.active::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: white;
  border-radius: 3px 0 0 3px;
  opacity: 0.9;
  box-shadow: -2px 0 8px rgba(255,255,255,0.3);
}

.sidebar-nav-icon {
  font-size: 1.25rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  opacity: 1;
  transition: all var(--duration) var(--ease);
}

.sidebar-nav a:hover .sidebar-nav-icon {
  opacity: 1;
}

.sidebar-nav a.active .sidebar-nav-icon {
  opacity: 1;
}

.sidebar-nav-label {
  position: relative;
  z-index: 1;
  flex: 1;
}

/* Sidebar Search */
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0.75rem;
  padding: 0.625rem 0.875rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  transition: all var(--duration) var(--ease);
}

.sidebar-search:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
}

.sidebar-search i {
  font-size: 1rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.9);
  font-size: 0.875rem;
  outline: none;
}

.sidebar-search-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.sidebar-search-hint {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}

/* Sidebar Nav Reorganized */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li {
  margin: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--duration) var(--ease);
  position: relative;
  margin: 0.25rem 0.75rem;
  border-radius: 12px;
}

.sidebar-nav a i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  transition: all var(--duration) var(--ease);
}

.sidebar-nav a:hover {
  background: rgba(229,49,28,0.1);
  color: rgba(255,255,255,0.85);
}

.sidebar-nav a.active {
  background: #E5311C;
  color: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(229,49,28,0.3);
}

.sidebar-nav a.active i {
  color: white;
}

/* Menu Labels */
.sidebar-menu-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.4);
  padding: 0.75rem 1.5rem 0.375rem;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.sidebar-menu-label:first-child {
  margin-top: 0;
}

/* Sidebar Footer (User) */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 12px;
  transition: background var(--duration) var(--ease);
}

.sidebar-user:hover {
  background: rgba(255,255,255,0.08);
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== Main Content ========== */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== Topbar ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 1.25rem 2rem 0;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 4px 24px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: box-shadow var(--duration) var(--ease), margin var(--duration) var(--ease);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: rgba(255,255,255,0.75);
  border: 1px solid #E4E7EC;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  width: 280px;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}

.topbar-search:focus-within {
  border-color: var(--primary);
  box-shadow: var(--input-focus-shadow);
  background: white;
}

.topbar-search-icon {
  color: var(--text-muted);
  font-size: 1rem;
  flex-shrink: 0;
}

.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.8125rem;
  font-family: var(--font);
  color: var(--text-primary);
  width: 100%;
}

.topbar-search input::placeholder {
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
}

.topbar-icon-btn:hover {
  background: #F4F5F7;
  color: var(--text-primary);
}

.topbar-icon-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid white;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: #E8EAF0;
  margin: 0 0.5rem;
}

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.topbar-profile:hover {
  background: #F4F5F7;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sidebar-start), var(--sidebar-end));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.topbar-profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.topbar-profile-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-profile-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.topbar-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

/* ========== Content Area ========== */
.app-content {
  flex: 1;
  padding: 1.5rem 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.app-footer {
  padding: 1rem 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: white;
  margin: 2rem 2rem 0;
  border-radius: 20px 20px 0 0;
}

/* ========== Page Header ========== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.page-header h1 {
  margin: 0;
  font-size: 2.625rem;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1.15;
}

.page-header-subtitle {
  font-size: 0.9375rem;
  color: #7A7F87;
  margin: 0.25rem 0 0;
  font-weight: 400;
}

.page-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

/* ========== Cards ========== */
.card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: all var(--duration) var(--ease);
}

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

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

.card-header {
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid #F0F0F0;
  background: transparent;
}

.card-header h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text-primary);
}

.card-body {
  padding: 2rem;
}

.card-footer {
  padding: 1.25rem 2rem 1.75rem;
  border-top: 1px solid #F0F0F0;
  background: transparent;
}

/* Cards that shouldn't lift on hover */
.card.static:hover {
  transform: none;
  box-shadow: var(--card-shadow);
}

/* ========== Stat Cards ========== */
.stat-card {
  background: white;
  border: var(--card-border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 1rem 1.25rem;
  transition: box-shadow 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--card-hover-shadow);
}

/* ========== Workflow Pipeline ========== */
.workflow-pipeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 0;
  overflow-x: auto;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 100px;
  position: relative;
}

.workflow-step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: 2px solid #E8EAF0;
  background: white;
  color: var(--text-muted);
  transition: all 0.3s;
}

.workflow-step.active .workflow-step-dot {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(229,49,28,0.12);
}

.workflow-step.completed .workflow-step-dot {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.workflow-step-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.workflow-step.active .workflow-step-label {
  color: var(--text-primary);
  font-weight: 600;
}

.workflow-connector {
  flex: 1;
  min-width: 24px;
  height: 2px;
  background: #E8EAF0;
  position: relative;
}

.workflow-connector.completed {
  background: var(--success);
}

/* ========== Activity Feed ========== */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #F0F0F0;
  transition: background 0.2s;
}

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

.activity-item:hover {
  background: #FAFBFC;
  margin: 0 -0.75rem;
  padding: 1rem 0.75rem;
  border-radius: 12px;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.status-created { background: var(--primary); }
.activity-dot.status-submitted { background: var(--warning); }
.activity-dot.status-completed { background: var(--success); }
.activity-dot.status-in_progress { background: var(--info); }

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 0.8125rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.activity-text strong {
  font-weight: 600;
}

.activity-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ========== Deadline Alerts ========== */
.deadline-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 14px;
  margin-bottom: 0.5rem;
  transition: background 0.2s;
}

.deadline-item:hover {
  background: #F9FAFB;
}

.deadline-item.urgent {
  background: #FEF2F2;
  border: 1px solid #FECACA;
}

.deadline-item.warning {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
}

.deadline-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.deadline-item.urgent .deadline-icon {
  background: #FEE2E2;
  color: #DC2626;
}

.deadline-item.warning .deadline-icon {
  background: #FEF3C7;
  color: #D97706;
}

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

.deadline-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.deadline-date {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ========== Section Titles ========== */
.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  margin: 0 0 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.15;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 28px;
  background: linear-gradient(180deg, #E5311C, #EF4423);
  border-radius: 999px;
  flex-shrink: 0;
}

/* ========== Form Section Cards ========== */
.form-section-card {
  background: #FFFFFF;
  border: 1px solid #ECEFF3;
  border-radius: 28px;
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.05);
}

.section-divider {
  border-top: 1px solid #F0F2F5;
  padding-top: 32px;
  margin-top: 32px;
}

/* ========== Forms ========== */
.form-section {
  margin-bottom: 2.5rem;
}

.form-group {
  margin-bottom: 28px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 650;
  color: #111827;
}

.required-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  background: #DCFCE7;
  color: #16A34A;
  padding: 0.125rem 0.5rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-control {
  width: 100%;
  height: var(--input-height);
  padding: 0.75rem 1.125rem;
  font-size: 0.9375rem;
  font-family: var(--font);
  border: var(--input-border);
  border-radius: var(--input-radius);
  background: var(--input-bg);
  color: var(--text-primary);
  outline: none;
  box-shadow: var(--input-inset-shadow);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.form-control:focus {
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-shadow), var(--input-inset-shadow);
  background: #FFFFFF;
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: #8D99AE;
  font-size: 0.875rem;
  font-weight: 400;
}

.form-control.is-invalid {
  border-color: var(--error);
  background: #FEF2F2;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(220,38,38,0.12);
}

textarea.form-control {
  height: auto;
  min-height: 160px;
  resize: vertical;
  padding: 22px 24px;
  line-height: 1.6;
}

.textarea-wrapper textarea.form-control {
  padding-bottom: 36px;
}

.textarea-wrapper {
  position: relative;
}

.textarea-wrapper .char-count {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 12px;
  color: #98A2B3;
  pointer-events: none;
  background: white;
  padding: 0 4px;
}

.textarea-wrapper textarea.form-control {
  padding-bottom: 32px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.125rem center;
  padding-right: 2.75rem;
  cursor: pointer;
}

.invalid-feedback {
  display: block;
  font-size: 0.8125rem;
  color: var(--error);
  margin-top: 0.375rem;
  font-weight: 400;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 12px;
  color: #98A2B3;
  margin-top: 6px;
}

.char-count.over {
  color: var(--error);
}

/* ========== Form Grid ========== */
.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 1.5rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 1.5rem;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: var(--btn-primary-gradient);
  color: white;
  box-shadow: var(--btn-primary-shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-primary-hover-shadow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #F3F4F6;
  color: var(--text-primary);
  border: 1px solid #E8EAF0;
}

.btn-secondary:hover {
  background: #E5E7EB;
  border-color: #D1D5DB;
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #B91C1C;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  border-radius: 10px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 0.9375rem;
  border-radius: 16px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.5rem;
  border-radius: 10px;
}

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

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ========== Tables ========== */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.table thead th {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #F9FAFB;
  border-bottom: 1px solid #F0F0F0;
}

.table thead th:first-child { border-radius: 12px 0 0 0; }
.table thead th:last-child { border-radius: 0 12px 0 0; }

.table tbody td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #F0F0F0;
  font-size: 0.8125rem;
  color: var(--text-primary);
  transition: background 0.15s;
  vertical-align: middle;
}

.table tbody tr {
  transition: all 0.15s ease;
}

.table tbody tr:hover td {
  background: #F9FAFB;
}

.table tbody tr:hover td:first-child {
  border-left: 2px solid #E5311C;
}

.table tbody tr:last-child td:first-child { border-radius: 0 0 0 12px; }
.table tbody tr:last-child td:last-child { border-radius: 0 0 12px 0; }
.table tbody tr:last-child td { border-bottom: none; }

.table-wrapper {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid #F0F2F5;
}

.table-row-meta {
  display: flex; align-items: center; gap: 0.625rem;
}
.table-row-meta .avatar, .table-row-meta .avatar-sm { flex-shrink: 0; }
.table-row-name { font-weight: 500; font-size: 0.875rem; color: #111827; }
.table-row-sub { font-size: 0.75rem; color: #98A2B3; }

.table thead th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #F9FAFB;
  border-bottom: 1px solid #F0F0F0;
}

.table thead th:first-child {
  border-radius: 12px 0 0 0;
}

.table thead th:last-child {
  border-radius: 0 12px 0 0;
}

.table tbody td {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid #F0F0F0;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: background 0.15s;
}

.table tbody tr {
  transition: background 0.15s;
}

.table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 12px;
}

.table tbody tr:last-child td:last-child {
  border-radius: 0 0 12px 0;
}

.table tbody tr:hover td {
  background: #F9FAFB;
}

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

/* ========== Status Chips ========== */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.status-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-chip-draft { background: #FFF7ED; color: #D97706; }
.status-chip-draft::before { background: #D97706; }
.status-chip-submitted { background: #EEF4FF; color: #356AE6; }
.status-chip-submitted::before { background: #356AE6; }
.status-chip-under_review { background: #F3E8FF; color: #6B21A8; }
.status-chip-under_review::before { background: #9333EA; }
.status-chip-assigned_to_creative { background: #FCE7F3; color: #9D174D; }
.status-chip-assigned_to_creative::before { background: #EC4899; }
.status-chip-in_progress { background: #EEF4FF; color: #356AE6; }
.status-chip-in_progress::before { background: #356AE6; }
.status-chip-completed { background: #ECFDF3; color: #16A34A; }
.status-chip-completed::before { background: #16A34A; }
.status-chip-archived { background: #F3F4F6; color: #6B7280; }
.status-chip-archived::before { background: #9CA3AF; }
.status-chip-need_clarification { background: #FFF7ED; color: #D97706; }
.status-chip-need_clarification::before { background: #D97706; }

/* ========== Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-success { background: #DCFCE7; color: #16A34A; }
.badge-warning { background: #FEF3C7; color: #D97706; }
.badge-danger { background: #FEE2E2; color: #DC2626; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-primary { background: #FCE7F3; color: #BE185D; }

/* ========== Upload Area ========== */
.upload-area {
  border: 2px dashed #E8EAF0;
  border-radius: var(--input-radius);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s;
  background: #FAFBFC;
  cursor: pointer;
}

.upload-area:hover {
  border-color: var(--primary);
  background: #FEF2F2;
}

.upload-area-input {
  display: none;
}

.upload-area-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.upload-area-icon {
  font-size: 2rem;
  color: var(--primary);
}

.upload-area-text {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.upload-area-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.uploaded-files {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.uploaded-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #FAFBFC;
  border-radius: 12px;
  border: 1px solid #F0F0F0;
  font-size: 0.875rem;
  gap: 0.75rem;
  transition: all 0.2s;
}

.uploaded-file:hover {
  background: #F3F4F6;
}

.uploaded-file-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-file-name i {
  color: var(--primary);
  flex-shrink: 0;
}

.uploaded-file .btn-remove {
  padding: 0.25rem 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.125rem;
  border-radius: 6px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.uploaded-file .btn-remove:hover {
  background: #FEE2E2;
  color: var(--error);
}

/* ========== Progress Bar ========== */
.progress {
  height: 6px;
  background: #F0F0F0;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--sidebar-start), var(--sidebar-end));
  border-radius: 6px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ========== Comments ========== */
.comment-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid #F0F0F0;
}

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

.comment-author {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.comment-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.1rem 0 0.5rem;
}

.comment-body {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ========== History ========== */
.history-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #F0F0F0;
}

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

.history-user {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.history-transition {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0.25rem 0;
}

.history-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.history-notes {
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  color: var(--text-secondary);
}

/* ========== Action Sidebar ========== */
.action-card {
  background: #FFFFFF;
  border: 1px solid #E7EAF0;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.06);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  position: sticky;
  top: 100px;
}

.action-card h6 {
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--text-primary);
  margin: 0 0 1rem;
}

/* ========== Client Cards ========== */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.client-card {
  background: white;
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.client-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-hover-shadow);
}

.client-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.client-card-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.client-card-name {
  font-size: 1.125rem;
  font-weight: 650;
  color: var(--text-primary);
  margin: 0;
}

.client-card-industry {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.client-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.client-card-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.client-card-stat-label {
  color: var(--text-secondary);
}

.client-card-stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.client-card-footer {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #F0F0F0;
  margin-top: auto;
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 3rem;
  color: #D1D5DB;
  margin-bottom: 1.5rem;
  display: block;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ========== Alert / Flash ========== */
.flash-container {
  margin-bottom: 1.5rem;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-error, .alert-danger { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

.alert-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ========== Detail Table ========== */
.detail-table td {
  padding: 0.75rem 1rem 0.75rem 0;
  vertical-align: top;
  font-size: 0.875rem;
}

.detail-table td:first-child {
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  width: 1px;
  padding-right: 2rem;
}

.detail-table td:last-child {
  color: var(--text-primary);
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 2rem;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.875rem;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.pagination a.active {
  background: var(--btn-primary-gradient);
  color: white;
  box-shadow: var(--btn-primary-shadow);
}

.pagination a:not(.active) {
  background: white;
  color: var(--text-secondary);
  border: 1px solid #E8EAF0;
}

.pagination a:not(.active):hover {
  background: #F3F4F6;
  border-color: #D1D5DB;
  transform: translateY(-1px);
}

/* ========== Filter Bar ========== */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-bar .form-control {
  height: 44px;
  font-size: 0.8125rem;
  padding: 0.5rem 0.875rem;
}

/* ========== Responsive ========== */
@media (max-width: 1200px) {
  .form-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .form-row, .form-row-2 { grid-template-columns: 1fr; }

  .page-header {
    flex-direction: column;
    gap: 1rem;
  }

  .page-header h1 { font-size: 2rem; }

  .topbar { margin: 1rem; }
  .topbar-search { width: 200px; }

  .app-content { padding: 1rem; }
  .app-footer { margin: 1rem; }

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .app-main {
    margin-left: 0;
  }

  .topbar-search { width: 140px; }
  .topbar-profile-info { display: none; }

  .page-header h1 { font-size: 1.625rem; }

  .stat-card-value { font-size: 1.75rem; }

  .workflow-pipeline { padding: 1rem 0; }
  .workflow-step { min-width: 70px; }
}

/* ========== Utilities ========== */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2.5rem; }

.text-muted { color: var(--text-secondary); }
.text-danger { color: var(--error); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.d-none { display: none; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.w-100 { width: 100%; }

/* ========== Enhanced Hover States ========== */
.btn, .card, .sidebar-nav a, .stat-card, .client-card, .upload-area, .status-chip, .action-card {
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card:not(.static):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}

.client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(229,49,28,0.22);
}

.sidebar-nav a:hover {
  transform: translateX(3px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(229,49,28,0.18);
}

/* ========== Sticky Save Bar ========== */
.sticky-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid #E8EAF0;
  box-shadow: 0 -8px 30px rgba(15,23,42,0.08);
  border-radius: 16px 16px 0 0;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -2rem;
  width: calc(100% + 4rem);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.sticky-save-bar.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sticky-save-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sticky-save-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ========== Autosave Indicator ========== */
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.save-status.saved { background: #ECFDF3; color: #16A34A; }
.save-status.saving { background: #F3F4F6; color: #6B7280; }
.save-status.unsaved { background: #FFF7ED; color: #D97706; }
.save-status.failed { background: #FEF2F2; color: #DC2626; }

/* ========== Collapsible Sections ========== */
.collapsible-section {
  background: #FFFFFF;
  border: 1px solid #ECEFF3;
  border-radius: 28px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.05);
  overflow: hidden;
  transition: box-shadow var(--duration) var(--ease);
}

.collapsible-section:hover {
  box-shadow: 0 12px 36px rgba(15,23,42,0.08);
}

.collapsible-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 32px; cursor: pointer; user-select: none; -webkit-user-select: none;
}

.collapsible-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.collapsible-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.collapsible-header-title {
  font-size: 1.125rem;
  font-weight: 650;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

.collapsible-header-desc {
  font-size: 0.8125rem;
  color: #6B7280;
  margin: 0;
}

.collapsible-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.collapsible-chevron {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
  font-size: 1rem;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s;
  flex-shrink: 0;
}

.collapsible-chevron:hover {
  background: #F3F4F6;
}

.collapsible-section.collapsed .collapsible-chevron {
  transform: rotate(-90deg);
}

.collapsible-body {
  padding: 0 26px 26px;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.collapsible-section.collapsed .collapsible-body {
  max-height: 0 !important;
  padding: 0 26px;
}

/* ========== Section Completion Chips ========== */
.completion-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.completion-chip.incomplete { background: #F3F4F6; color: #6B7280; }
.completion-chip.progress { background: #FFF7ED; color: #D97706; }
.completion-chip.complete { background: #ECFDF3; color: #16A34A; }

/* ========== Floating Action Button ========== */
.fab-container {
  position: fixed;
  bottom: 100px;
  right: 32px;
  z-index: 45;
}

.fab-main {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E5311C, #C4280F);
  box-shadow: 0 8px 20px rgba(229,49,28,0.22);
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  z-index: 2;
}

.fab-main:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 24px rgba(229,49,28,0.28);
}

.fab-main:active {
  transform: scale(0.95);
}

.fab-menu {
  position: absolute;
  bottom: 68px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1;
}

.fab-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  background: white;
  border: 1px solid #ECEFF3;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15,23,42,0.06);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.fab-menu-item:hover {
  background: #F9FAFB;
  transform: translateX(-3px);
}

.fab-menu-item i {
  font-size: 1rem;
  color: #E5311C;
}

/* ========== Toast Notifications ========== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  background: #FFFFFF;
  border: 1px solid #ECEFF3;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15,23,42,0.12);
  padding: 16px 18px;
  min-width: 320px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.toast.removing {
  animation: toastOut 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(24px) scale(0.96); }
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-icon.success { background: #ECFDF3; color: #16A34A; }
.toast-icon.error { background: #FEF2F2; color: #DC2626; }
.toast-icon.warning { background: #FFF7ED; color: #D97706; }
.toast-icon.info { background: #EFF6FF; color: #3B82F6; }

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.toast-message {
  font-size: 0.8125rem;
  color: #6B7280;
  margin: 0.15rem 0 0;
  line-height: 1.4;
}

.toast-close {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #9CA3AF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: all 0.15s;
}

.toast-close:hover {
  background: #F3F4F6;
  color: #111827;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #F0F0F0;
  width: 100%;
}

.toast-progress-bar {
  height: 100%;
  border-radius: 0 3px 3px 0;
  transition: width linear;
}

.toast-progress-bar.success { background: #16A34A; }
.toast-progress-bar.error { background: #DC2626; }
.toast-progress-bar.warning { background: #D97706; }
.toast-progress-bar.info { background: #3B82F6; }

/* ========== Loading States ========== */
.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-secondary.is-loading::after {
  border-color: rgba(0,0,0,0.1);
  border-top-color: #6B7280;
}

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

.skeleton {
  background: linear-gradient(90deg, #F3F4F6, #EDEFF3, #F3F4F6);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 12px;
}

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

.skeleton-card {
  height: 120px;
  margin-bottom: 16px;
}

.skeleton-line {
  height: 16px;
  margin-bottom: 10px;
}

.skeleton-line:last-child {
  width: 60%;
}

/* ========== Drag & Drop Upload ========== */
.upload-area.dragover {
  border-color: #E5311C;
  background: #FDF0EF;
  transform: scale(1.01);
}

.upload-area.dragover .upload-area-icon {
  transform: translateY(-4px);
}

.upload-area-icon {
  transition: transform 0.2s ease;
}

/* ========== Validation Polish ========== */
.invalid-feedback {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 13px;
  color: #DC2626;
  margin-top: 8px;
  font-weight: 400;
  animation: slideDown 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.form-control.is-invalid {
  border-color: #DC2626;
  box-shadow: 0 0 0 4px rgba(220,38,38,0.10);
}

/* ========== Page Transition ========== */
.app-content {
  animation: fadeIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* ========== Button Focus Ring ========== */
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(229,49,28,0.18);
}

/* ========== Select Dropdown Chevron Animation ========== */
select.form-control {
  transition: all 0.2s ease, background-image 0s;
}

/* ========== Command Palette / Global Search ========== */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.3);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cmd-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cmd-palette {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translateX(-50%) scale(0.96) translateY(-8px);
  width: 640px;
  max-width: calc(100vw - 48px);
  max-height: 60vh;
  background: white;
  border: 1px solid #ECEFF3;
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(15,23,42,0.16);
  z-index: 301;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}

.cmd-palette.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1) translateY(0);
}

.cmd-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #F0F2F5;
}

.cmd-search-icon {
  font-size: 1.125rem;
  color: #98A2B3;
  flex-shrink: 0;
}

.cmd-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: var(--font);
  color: #111827;
  background: transparent;
}

.cmd-search input::placeholder {
  color: #98A2B3;
}

.cmd-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #F3F4F6;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6B7280;
  flex-shrink: 0;
}

.cmd-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  max-height: 400px;
}

.cmd-group {
  margin-bottom: 0.5rem;
}

.cmd-group-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #98A2B3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 0.75rem 0.25rem;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: #111827;
  transition: all 0.1s ease;
}

.cmd-item:hover,
.cmd-item.active {
  background: #F5F6F8;
}

.cmd-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  flex-shrink: 0;
  background: #F3F4F6;
  color: #E5311C;
}

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

.cmd-item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

.cmd-item-desc {
  font-size: 0.75rem;
  color: #98A2B3;
  margin-top: 0.05rem;
}

.cmd-item-badge {
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
  background: #F3F4F6;
  color: #6B7280;
  font-weight: 500;
  flex-shrink: 0;
}

.cmd-empty {
  text-align: center;
  padding: 2rem;
  color: #98A2B3;
  font-size: 0.875rem;
}

/* ========== Avatars ========== */
.avatar {
  width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: white;
  flex-shrink: 0; position: relative;
}
.avatar-sm { width: 24px; height: 24px; border-radius: 8px; font-size: 0.625rem; }
.avatar-lg { width: 40px; height: 40px; border-radius: 12px; font-size: 0.875rem; }

.avatar-group {
  display: flex; align-items: center;
}
.avatar-group .avatar {
  border: 2px solid white; margin-right: -8px;
}
.avatar-group .avatar:last-child { margin-right: 0; }

/* ========== Inline Metadata ========== */
.inline-meta {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  font-size: 0.75rem; color: #6B7280;
}
.inline-meta span { display: inline-flex; align-items: center; gap: 0.25rem; }
.inline-meta i { font-size: 0.8125rem; }
.inline-meta strong { color: #111827; font-weight: 600; }

.meta-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.5rem; border-radius: 6px;
  font-size: 0.6875rem; font-weight: 500;
  background: #F3F4F6; color: #6B7280;
}

/* ========== Smart Filter Chips ========== */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  background: #E5E7EB;
}

.filter-chip.active {
  background: #FEF2F2;
  border-color: #E5311C;
  color: #E5311C;
}

.filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.625rem;
  margin-left: 0.125rem;
  transition: all 0.15s;
}

.filter-chip.active .filter-chip-remove {
  background: #E5311C;
  color: white;
}

/* ========== Quick Create Menu ========== */
.quick-create-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.quick-create-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ========== Dashboard Widgets ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.dashboard-widget {
  background: white;
  border: 1px solid #E4E7EC;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(16,24,40,0.04), 0 12px 24px rgba(16,24,40,0.06);
  padding: 1.25rem;
  transition: box-shadow var(--duration) var(--ease);
}

.dashboard-widget:hover {
  box-shadow: 0 2px 8px rgba(16,24,40,0.04), 0 16px 32px rgba(16,24,40,0.08);
}

.dashboard-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dashboard-widget-title {
  font-size: 0.875rem;
  font-weight: 650;
  color: #111827;
  margin: 0;
}

.dashboard-widget-count {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #98A2B3;
  padding: 0.2rem 0.5rem;
  background: #F3F4F6;
  border-radius: 100px;
}

.approval-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #F0F2F5;
  transition: background 0.15s;
}

.approval-item:last-child { border-bottom: none; }
.approval-item:hover { background: #F9FAFB; margin: 0 -0.5rem; padding: 0.75rem 0.5rem; border-radius: 12px; }

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

.approval-item .approval-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #111827;
}

.approval-item .approval-meta {
  font-size: 0.6875rem;
  color: #98A2B3;
  margin-top: 0.1rem;
}

/* ========== Progress Ring ========== */
.progress-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: #F0F2F5;
  stroke-width: 3;
}

.progress-ring-fill {
  fill: none;
  stroke: #E5311C;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.progress-ring-text {
  position: absolute;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #111827;
}

/* ========== Dashboard Section Containers ========== */
.dashboard-section {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: box-shadow var(--duration) var(--ease);
}

.dashboard-section:hover {
  box-shadow: 0 2px 8px rgba(16,24,40,0.04);
}

.dashboard-section-title {
  font-size: 0.9375rem;
  font-weight: 650;
  color: #111827;
  margin: 0 0 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-section-title i {
  font-size: 1.125rem;
  color: var(--primary);
  opacity: 0.8;
}

/* Enhanced Stat Cards */
.stat-card {
  background: white;
  border: 1px solid #E4E7EC;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 1.25rem;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
  border-color: #D1D5DB;
}

/* Dashboard Grid Sections */
.dashboard-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.dashboard-section-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.dashboard-widget {
  background: white;
  border: 1px solid #E4E7EC;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(16,24,40,0.04), 0 12px 24px rgba(16,24,40,0.06);
  padding: 1.25rem;
  transition: all var(--duration) var(--ease);
}

.dashboard-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(16,24,40,0.04), 0 16px 32px rgba(16,24,40,0.08);
  border-color: #D1D5DB;
}

/* Activity Timeline */
.activity-timeline {
  position: relative;
  padding-left: 0;
}

.activity-timeline .activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #F0F0F0;
  align-items: flex-start;
}

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

.activity-timeline .activity-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 2;
}

.activity-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: #E5E7EB;
  border-radius: 1px;
}

/* Recent Items Grid */
.recent-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.recent-item-card {
  background: white;
  border: 1px solid #E4E7EC;
  border-radius: 16px;
  padding: 1rem;
  transition: all var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
}

.recent-item-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(229,49,28,0.08);
  transform: translateY(-2px);
}

.recent-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.recent-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: #F3F4F7;
  color: var(--primary);
}

.recent-item-content {
  flex: 1;
  min-width: 0;
}

.recent-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-item-meta {
  font-size: 0.75rem;
  color: #98A2B3;
  margin: 0.25rem 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid #F0F0F0;
}

/* Print Styles */
@media print {
  .sidebar,
  .topbar,
  .sticky-save-bar,
  .fab-container,
  .btn,
  .page-header-actions {
    display: none !important;
  }

  .app-main {
    margin-left: 0 !important;
  }

  .app-content {
    padding: 0 !important;
    animation: none !important;
  }

  .card,
  .collapsible-section,
  .form-section-card {
    box-shadow: none !important;
    border: 1px solid #E5E7EB !important;
    break-inside: avoid;
  }

  .collapsible-body {
    max-height: none !important;
    padding: 0 26px 26px !important;
  }

  .collapsible-section.collapsed .collapsible-body {
    max-height: none !important;
    padding: 0 26px 26px !important;
  }

  body { background: white; }
}

/* ========== Responsive Enhancements ========== */
@media (max-width: 768px) {
  .cmd-palette {
    top: 10%;
    width: calc(100vw - 24px);
    max-height: 75vh;
  }

  .sticky-save-bar {
    padding: 14px 16px;
    margin: 0 -1rem;
    width: calc(100% + 2rem);
    border-radius: 16px 16px 0 0;
  }

  .sticky-save-bar-left .save-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
  }

  .fab-container {
    bottom: 80px;
    right: 16px;
  }

  .fab-main {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

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

  .table tbody td {
    padding: 0.75rem 1rem;
  }

  .table thead th {
    padding: 0.75rem 1rem;
  }
}

/* ========== Collaboration Sidebar ========== */
.collab-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  height: 100vh;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid #ECEFF3;
  z-index: 150;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
  box-shadow: -8px 0 30px rgba(15,23,42,0.06);
}

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

.collab-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #F0F2F5;
  flex-shrink: 0;
}

.collab-sidebar-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 650;
  color: #111827;
}

.collab-sidebar-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: all 0.15s;
}

.collab-sidebar-close:hover { background: #F3F4F6; color: #111827; }

.collab-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #F0F2F5;
  flex-shrink: 0;
  overflow-x: auto;
}

.collab-tab {
  padding: 0.5rem 0.875rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.collab-tab:hover { background: #F3F4F6; color: #111827; }
.collab-tab.active { background: #FEF2F2; color: #E5311C; font-weight: 600; }

.collab-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.375rem;
  border-radius: 100px;
  font-size: 0.625rem;
  font-weight: 600;
  background: #F3F4F6;
  color: #6B7280;
}

.collab-tab.active .collab-tab-count {
  background: #E5311C;
  color: white;
}

.collab-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.collab-body::-webkit-scrollbar { width: 4px; }
.collab-body::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 4px; }

/* ========== Comment Thread ========== */
.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-card {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: #F9FAFB;
  border-radius: 14px;
  transition: background 0.15s;
}

.comment-card:hover { background: #F3F4F6; }

.comment-card .avatar { flex-shrink: 0; }

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.comment-author {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
}

.comment-role {
  font-size: 0.6875rem;
  color: #98A2B3;
}

.comment-time {
  font-size: 0.6875rem;
  color: #98A2B3;
  margin-left: auto;
}

.comment-text {
  font-size: 0.8125rem;
  color: #374151;
  line-height: 1.5;
}

.comment-text .mention {
  color: #E5311C;
  font-weight: 500;
  cursor: pointer;
}

.comment-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.comment-action {
  padding: 0.2rem 0.5rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #98A2B3;
  cursor: pointer;
  transition: all 0.15s;
}

.comment-action:hover { background: #E5E7EB; color: #374151; }

.comment-reply {
  margin-left: 2.5rem;
  padding-left: 0.75rem;
  border-left: 2px solid #E5E7EB;
  margin-top: 0.5rem;
}

.comment-input-area {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 0;
  align-items: flex-start;
}

.comment-input-area .comment-input-wrapper {
  flex: 1;
  position: relative;
}

.comment-input-area textarea {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  padding: 0.625rem 0.875rem;
  border: 1px solid #D7DEE8;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-family: var(--font);
  resize: none;
  outline: none;
  transition: all 0.15s;
  background: var(--input-bg);
}

.comment-input-area textarea:focus {
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-shadow);
}

/* ========== Mentions Dropdown ========== */
.mentions-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 280px;
  background: #FFFFFF;
  border: 1px solid #ECEFF3;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15,23,42,0.12);
  margin-bottom: 4px;
  overflow: hidden;
  display: none;
  z-index: 50;
}

.mentions-dropdown.open { display: block; }

.mentions-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  transition: background 0.1s;
}

.mentions-item:hover,
.mentions-item.active { background: #F9FAFB; }

.mentions-item .avatar { width: 28px; height: 28px; border-radius: 8px; font-size: 0.625rem; }

.mentions-info { flex: 1; min-width: 0; }
.mentions-name { font-size: 0.8125rem; font-weight: 500; color: #111827; }
.mentions-role { font-size: 0.6875rem; color: #98A2B3; }

/* ========== Notification Center ========== */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 480px;
  background: #FFFFFF;
  border: 1px solid #ECEFF3;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(15,23,42,0.12);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 60;
}

.notif-dropdown.open { display: flex; }

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #F0F2F5;
}

.notif-header h4 { margin: 0; font-size: 0.9375rem; font-weight: 650; }
.notif-header button { border: none; background: none; font-size: 0.75rem; color: #E5311C; cursor: pointer; font-weight: 500; }

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item:hover { background: #F9FAFB; }
.notif-item.unread { background: #FDF0EF; }

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E5311C;
  flex-shrink: 0;
  margin-top: 6px;
}

.notif-item.read .notif-dot { background: transparent; }

.notif-content { flex: 1; min-width: 0; }
.notif-text { font-size: 0.8125rem; color: #374151; line-height: 1.4; }
.notif-text strong { font-weight: 600; color: #111827; }
.notif-time { font-size: 0.6875rem; color: #98A2B3; margin-top: 0.15rem; }

.notif-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: #98A2B3;
  font-size: 0.8125rem;
}

/* ========== Approval Panel ========== */
.approval-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.approval-stage {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: #F9FAFB;
  border-radius: 14px;
  border-left: 3px solid #E5E7EB;
}

.approval-stage.completed { border-left-color: #16A34A; }
.approval-stage.active { border-left-color: #E5311C; background: #FDF0EF; }
.approval-stage.rejected { border-left-color: #DC2626; }

.approval-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.approval-stage-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
}

.approval-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.approval-chip.approved { background: #ECFDF3; color: #16A34A; }
.approval-chip.rejected { background: #FEF2F2; color: #DC2626; }
.approval-chip.revision { background: #FFF7ED; color: #D97706; }
.approval-chip.pending { background: #F3F4F6; color: #6B7280; }

.approval-reviewer {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.approval-reviewer .avatar { flex-shrink: 0; }

.approval-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.approval-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.approval-btn.approve { background: #ECFDF3; color: #16A34A; }
.approval-btn.approve:hover { background: #DCFCE7; }
.approval-btn.reject { background: #FEF2F2; color: #DC2626; }
.approval-btn.reject:hover { background: #FEE2E2; }
.approval-btn.revision { background: #FFF7ED; color: #D97706; }
.approval-btn.revision:hover { background: #FEF3C7; }

/* ========== Activity Timeline ========== */
.activity-timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: 0;
  width: 1px;
  background: #E5E7EB;
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-content { flex: 1; min-width: 0; }
.timeline-text { font-size: 0.8125rem; color: #374151; line-height: 1.4; }
.timeline-text strong { font-weight: 600; color: #111827; }
.timeline-time { font-size: 0.6875rem; color: #98A2B3; margin-top: 0.1rem; }

/* ========== Brief Open Button ========== */
.open-collab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.open-collab-btn:hover { background: #E5E7EB; }
.open-collab-btn i { color: #E5311C; }
.open-collab-btn .notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.375rem;
  border-radius: 100px;
  font-size: 0.625rem;
  font-weight: 600;
  background: #E5311C;
  color: white;
}

/* ========== Lightbox ========== */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(15,23,42,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }

.lightbox-card {
  background: #FFFFFF; border-radius: 24px;
  box-shadow: 0 24px 64px rgba(15,23,42,0.2);
  max-width: 90vw; max-height: 85vh; overflow: hidden;
  display: flex; flex-direction: column;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.25s var(--ease);
}
.lightbox-overlay.open .lightbox-card { transform: scale(1) translateY(0); }

.lightbox-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid #F0F2F5; flex-shrink: 0;
}
.lightbox-title {
  font-size: 0.9375rem; font-weight: 600; color: #111827;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lightbox-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: #F3F4F6; color: #6B7280; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem; transition: all 0.15s; flex-shrink: 0;
}
.lightbox-close:hover { background: #E5E7EB; color: #111827; }

.lightbox-body {
  flex: 1; overflow: auto; display: flex;
  align-items: center; justify-content: center;
  padding: 1rem; min-height: 160px;
}
.lightbox-body img { max-width: 100%; max-height: 65vh; border-radius: 12px; object-fit: contain; }
.lightbox-file-preview {
  text-align: center; padding: 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.lightbox-file-icon { font-size: 4rem; }
.lightbox-file-name { font-size: 1rem; font-weight: 600; color: #111827; }
.lightbox-actions {
  display: flex; gap: 0.5rem; padding: 1rem 1.25rem;
  border-top: 1px solid #F0F2F5; flex-shrink: 0; justify-content: flex-end;
}

