/* ============================================================
   WorkPally — Global Design System
   Brand Color: Coral #F0795A | Light Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

/* ────────────────────────────────────────────────────────────
   CSS Custom Properties — Light Theme
──────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:        #F0795A;
  --primary-dark:   #D4624A;
  --primary-light:  #F5A08A;
  --primary-glow:   rgba(240, 121, 90, 0.20);
  --primary-subtle: rgba(240, 121, 90, 0.08);

  /* Light Backgrounds */
  --bg-base:      #F4F5F7;
  --bg-card:      #FFFFFF;
  --bg-surface:   #F8F9FB;
  --bg-elevated:  #EEF0F4;
  --bg-hover:     #E8EAF0;

  /* Borders */
  --border:       rgba(0,0,0,0.08);
  --border-focus: rgba(240, 121, 90, 0.45);

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #4B5563;
  --text-muted:     #9CA3AF;
  --text-inverse:   #FFFFFF;

  /* Status Colors */
  --success:      #10B981;
  --success-bg:   rgba(16, 185, 129, 0.08);
  --danger:       #EF4444;
  --danger-bg:    rgba(239, 68, 68, 0.08);
  --warning:      #F59E0B;
  --warning-bg:   rgba(245, 158, 11, 0.08);
  --info:         #3B82F6;
  --info-bg:      rgba(59, 130, 246, 0.08);
  --purple:       #8B5CF6;
  --purple-bg:    rgba(139, 92, 246, 0.08);

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'Fira Code', monospace;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadows — lighter for white theme */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.12), 0 6px 18px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 24px var(--primary-glow);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s ease;
  --transition-slow:   0.4s ease;

  /* Layout */
  --sidebar-width:       260px;
  --sidebar-collapsed:    70px;
  --header-height:        64px;
  --content-max-width:  1400px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--primary-light); }

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

button, input, select, textarea {
  font-family: inherit;
  outline: none;
  border: none;
  background: none;
}

ul, ol { list-style: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

::selection { background: var(--primary); color: white; }

/* ────────────────────────────────────────────────────────────
   Typography
──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.85rem; }

p { color: var(--text-secondary); margin-bottom: var(--sp-4); }
p:last-child { margin-bottom: 0; }

small { font-size: 0.8rem; color: var(--text-muted); }
code { font-family: var(--font-mono); font-size: 0.875rem; background: var(--bg-elevated); padding: 2px 6px; border-radius: var(--radius-sm); color: var(--primary); }

.text-primary   { color: var(--primary) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-info      { color: var(--info) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.fw-300 { font-weight: 300; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.font-heading { font-family: var(--font-heading); }
.font-mono    { font-family: var(--font-mono); }

/* ────────────────────────────────────────────────────────────
   Layout Utilities
──────────────────────────────────────────────────────────── */
.d-flex        { display: flex; }
.d-grid        { display: grid; }
.d-block       { display: block; }
.d-none        { display: none; }
.d-inline-flex { display: inline-flex; }

.flex-1   { flex: 1; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }

.align-center  { align-items: center; }
.align-start   { align-items: flex-start; }
.align-end     { align-items: flex-end; }
.align-stretch { align-items: stretch; }

.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start   { justify-content: flex-start; }
.justify-end     { justify-content: flex-end; }

.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Spacing utilities */
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; }
.p-2 { padding: var(--sp-2); }
.p-3 { padding: var(--sp-3); }
.p-4 { padding: var(--sp-4); }
.p-5 { padding: var(--sp-5); }
.p-6 { padding: var(--sp-6); }
.p-8 { padding: var(--sp-8); }

.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed    { position: fixed; }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ────────────────────────────────────────────────────────────
   Buttons
──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1.5px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}
.btn:active::before { width: 200px; height: 200px; }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}
.btn-primary:active { transform: translateY(0); }

/* Secondary / Ghost */
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Ghost */
.btn-ghost {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: rgba(0,0,0,0.14);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: white;
  border-color: transparent;
}
.btn-danger:hover { background: #d63a5e; transform: translateY(-2px); }

/* Success */
.btn-success {
  background: var(--success);
  color: var(--text-inverse);
  border-color: transparent;
}
.btn-success:hover { background: #05b888; transform: translateY(-2px); }

/* Icon button */
.btn-icon {
  width: 38px; height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}
.btn-icon.btn-sm { width: 30px; height: 30px; font-size: 0.75rem; border-radius: var(--radius-sm); }
.btn-icon.btn-lg { width: 48px; height: 48px; font-size: 1.1rem; }

/* ────────────────────────────────────────────────────────────
   Cards
──────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.card:hover {
  border-color: rgba(240, 121, 90, 0.25);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.card-header h3, .card-header h4, .card-header h5 { margin: 0; }

.card-body { padding: var(--sp-6); }
.card-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--primary), transparent);
}
.stat-card:hover {
  border-color: rgba(240, 121, 90, 0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.stat-card-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-card-body { flex: 1; }
.stat-card-value { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-card-label { font-size: 0.8rem; color: var(--text-muted); margin-top: var(--sp-1); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card-change { font-size: 0.8rem; font-weight: 600; margin-top: var(--sp-2); display: flex; align-items: center; gap: var(--sp-1); }
.stat-card-change.up   { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* ────────────────────────────────────────────────────────────
   Badges
──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-primary { background: var(--primary-subtle); color: var(--primary); border: 1px solid rgba(240,121,90,0.3); }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(6,214,160,0.3); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,71,111,0.3); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(255,209,102,0.3); }
.badge-info    { background: var(--info-bg); color: var(--info); border: 1px solid rgba(79,195,247,0.3); }
.badge-purple  { background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(182,156,247,0.3); }
.badge-muted   { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }

/* Dot badge */
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ────────────────────────────────────────────────────────────
   Forms & Inputs
──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-5); }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-card);
  border: 1.5px solid #E5E7EB;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}
.form-control:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }

.form-control-icon { position: relative; }
.form-control-icon i {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
}
.form-control-icon .form-control { padding-left: 40px; }
.form-control-icon .icon-right { left: auto; right: 14px; cursor: pointer; }
.form-control-icon.icon-right-input .form-control { padding-right: 40px; }

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2360607A' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }

.form-check { display: flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: var(--sp-1); }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: var(--sp-1); }

.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-md) 0 0 var(--radius-md); flex: 1; }
.input-group .btn { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* ────────────────────────────────────────────────────────────
   Search Bar
──────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--bg-card);
  border: 1.5px solid #E5E7EB;
  border-radius: var(--radius-md);
  padding: 9px 16px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.search-bar i { color: var(--text-muted); font-size: 0.875rem; }
.search-bar input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  flex: 1;
  min-width: 0;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-card);
}

/* ────────────────────────────────────────────────────────────
   Avatar
──────────────────────────────────────────────────────────── */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-heading);
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.avatar-xs  { width: 24px;  height: 24px;  font-size: 0.65rem; }
.avatar-sm  { width: 32px;  height: 32px;  font-size: 0.75rem; }
.avatar-md  { width: 42px;  height: 42px;  font-size: 0.9rem; }
.avatar-lg  { width: 56px;  height: 56px;  font-size: 1.1rem; }
.avatar-xl  { width: 80px;  height: 80px;  font-size: 1.4rem; }
.avatar-2xl { width: 110px; height: 110px; font-size: 1.8rem; }

.avatar-group { display: flex; }
.avatar-group .avatar {
  border: 2px solid var(--bg-card);
  margin-left: -8px;
}
.avatar-group .avatar:first-child { margin-left: 0; }

/* ────────────────────────────────────────────────────────────
   Tabs
──────────────────────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tabs-nav::-webkit-scrollbar { display: none; }

.tab-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-link:hover { color: var(--text-secondary); background: var(--bg-surface); }
.tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-subtle);
}
.tab-link i { font-size: 0.875rem; }

.tab-pane { display: none; padding: var(--sp-6) 0; animation: fadeInUp 0.3s ease; }
.tab-pane.active { display: block; }

/* Pills style tabs */
.tabs-pills .tab-link {
  border-radius: var(--radius-full);
  border-bottom: none;
  padding: 8px 18px;
}
.tabs-pills .tab-link.active {
  background: var(--primary);
  color: white;
  border-bottom: none;
}
.tabs-pills .tab-link:hover:not(.active) { background: var(--bg-elevated); }

/* ────────────────────────────────────────────────────────────
   Table
──────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}
.data-table thead {
  background: var(--bg-surface);
}
.data-table thead th {
  padding: 13px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table thead th.sortable { cursor: pointer; }
.data-table thead th.sortable:hover { color: var(--text-primary); }
.data-table thead th.sort-asc::after  { content: ' ↑'; color: var(--primary); }
.data-table thead th.sort-desc::after { content: ' ↓'; color: var(--primary); }

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
  cursor: pointer;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-surface); }

.data-table tbody td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table .td-user { display: flex; align-items: center; gap: var(--sp-3); }
.data-table .td-user-name { font-weight: 600; color: var(--text-primary); font-size: 0.875rem; }
.data-table .td-user-sub  { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }

/* ────────────────────────────────────────────────────────────
   Modals
──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}
/* .active is supported as an alias for .open — used across many pages */
.modal-overlay.open,
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-base);
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1000px; }
.modal-sm { max-width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-header h3, .modal-header h4 { margin: 0; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,0.2); }

.modal-body { padding: var(--sp-6); }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

/* ────────────────────────────────────────────────────────────
   Toast Notifications
──────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  border: 1px solid;
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 400px;
  pointer-events: all;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  background: var(--bg-card);
}
.toast.show { transform: translateX(0); }
.toast.hide { transform: translateX(120%); }

.toast-success { background: #F0FDF9; border-color: rgba(16,185,129,0.35); }
.toast-danger  { background: #FEF2F2; border-color: rgba(239,68,68,0.35); }
.toast-warning { background: #FFFBEB; border-color: rgba(245,158,11,0.35); }
.toast-info    { background: #EFF6FF; border-color: rgba(59,130,246,0.35); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: var(--success); }
.toast-danger  .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--info); }

.toast-content { flex: 1; }
.toast-title   { font-weight: 700; font-size: 0.875rem; color: var(--text-primary); font-family: var(--font-heading); }
.toast-message { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.toast-close   { color: var(--text-muted); cursor: pointer; font-size: 0.875rem; flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }

/* ────────────────────────────────────────────────────────────
   Floating Action Button (FAB)
──────────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 58px; height: 58px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 8px 30px var(--primary-glow), var(--shadow-lg);
  transition: all var(--transition-base);
  z-index: 100;
  border: 2px solid rgba(255,255,255,0.1);
  animation: fabPulse 3s infinite;
}
.fab:hover {
  transform: scale(1.12) rotate(45deg);
  box-shadow: 0 12px 40px var(--primary-glow);
}
.fab-label {
  position: absolute;
  right: 70px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: all var(--transition-base);
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
.fab:hover .fab-label { opacity: 1; transform: translateX(0); }

/* ────────────────────────────────────────────────────────────
   Dropdown Menu
──────────────────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 500;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: all var(--transition-base);
  backdrop-filter: blur(20px);
}
.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.dropdown-menu-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 11px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.dropdown-menu-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  padding-left: 20px;
}
.dropdown-menu-item.danger:hover { color: var(--danger); background: var(--danger-bg); }
.dropdown-menu-item i { width: 16px; text-align: center; opacity: 0.7; }
.dropdown-divider { height: 1px; background: var(--border); margin: var(--sp-2) 0; }

/* ────────────────────────────────────────────────────────────
   Breadcrumb
──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-secondary); }
.breadcrumb-sep { color: var(--text-muted); opacity: 0.4; font-size: 0.7rem; }

/* ────────────────────────────────────────────────────────────
   Progress Bar
──────────────────────────────────────────────────────────── */
.progress { height: 6px; background: #E5E7EB; border-radius: var(--radius-full); overflow: hidden; }
.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  transition: width 0.6s ease;
}
.progress-bar.success { background: linear-gradient(90deg, var(--success), #05e8a8); }
.progress-bar.danger  { background: linear-gradient(90deg, var(--danger), #f57a9c); }
.progress-bar.warning { background: linear-gradient(90deg, var(--warning), #ffe29a); }
.progress-bar.info    { background: linear-gradient(90deg, var(--info), #8dd8f8); }

/* ────────────────────────────────────────────────────────────
   Empty States
──────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-6);
  text-align: center;
}
.empty-state-icon {
  width: 80px; height: 80px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-5);
  border: 2px dashed var(--border);
}
.empty-state h3 { margin-bottom: var(--sp-2); font-size: 1.1rem; }
.empty-state p  { max-width: 300px; font-size: 0.875rem; }

/* ────────────────────────────────────────────────────────────
   Pagination
──────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.page-btn:hover { color: var(--text-primary); background: var(--bg-surface); border-color: rgba(0,0,0,0.12); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 12px var(--primary-glow); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ────────────────────────────────────────────────────────────
   Dividers
──────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: var(--sp-5) 0; }
.divider-label {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: var(--sp-5) 0;
}
.divider-label::before, .divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ────────────────────────────────────────────────────────────
   Chip / Tag
──────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: default;
}
.chip .chip-remove {
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: pointer;
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.chip .chip-remove:hover { background: var(--danger); color: white; }

/* ────────────────────────────────────────────────────────────
   Timeline / Activity Feed
──────────────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: var(--sp-8); }
.timeline::before {
  content: '';
  position: absolute;
  left: 16px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), transparent);
}
.timeline-item { position: relative; padding-bottom: var(--sp-6); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -32px; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.timeline-dot.success { background: var(--success); box-shadow: 0 0 0 3px rgba(6,214,160,0.2); }
.timeline-dot.danger  { background: var(--danger);  box-shadow: 0 0 0 3px rgba(239,71,111,0.2); }
.timeline-dot.warning { background: var(--warning); box-shadow: 0 0 0 3px rgba(255,209,102,0.2); }
.timeline-dot.info    { background: var(--info);    box-shadow: 0 0 0 3px rgba(79,195,247,0.2); }

.timeline-time   { font-size: 0.75rem; color: var(--text-muted); margin-bottom: var(--sp-1); }
.timeline-title  { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.timeline-body   { font-size: 0.8rem; color: var(--text-muted); margin-top: var(--sp-1); }

/* ────────────────────────────────────────────────────────────
   Kanban Board
──────────────────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-5);
  align-items: start;
}
.kanban-col {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.kanban-col-title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
}
.kanban-col-count {
  width: 22px; height: 22px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  color: var(--text-muted);
}
.kanban-cards { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); min-height: 60px; }

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover {
  border-color: rgba(240,121,90,0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kanban-card-title { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); margin-bottom: var(--sp-2); }
.kanban-card-meta  { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-3); }

/* ────────────────────────────────────────────────────────────
   Glassmorphism Panels
──────────────────────────────────────────────────────────── */
.glass {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-lg);
}
.glass-primary {
  background: rgba(240, 121, 90, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(240, 121, 90, 0.18);
}

/* ────────────────────────────────────────────────────────────
   Gradient Text
──────────────────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #FFD166 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ────────────────────────────────────────────────────────────
   Loading States
──────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #F3F4F6 25%, #E9EAEC 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius-md);
}
.skeleton-text    { height: 14px; margin-bottom: 8px; }
.skeleton-title   { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-circle  { border-radius: 50%; }
.skeleton-avatar  { width: 42px; height: 42px; border-radius: 50%; }
.skeleton-button  { height: 38px; width: 100px; }

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-sm  { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg  { width: 40px; height: 40px; border-width: 4px; }

/* ────────────────────────────────────────────────────────────
   Animations / Keyframes
──────────────────────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown{ from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInLeft  { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn   { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

@keyframes spin          { to { transform: rotate(360deg); } }
@keyframes skeleton-wave { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 8px 30px var(--primary-glow), 0 0 0 0 var(--primary-glow); }
  50% { box-shadow: 0 8px 30px var(--primary-glow), 0 0 0 8px transparent; }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
  50%       { box-shadow: 0 0 40px var(--primary-glow), 0 0 60px rgba(240,121,90,0.15); }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.4; }
  100% { transform: scale(4); opacity: 0; }
}

/* Animation utility classes */
.anim-fade-in      { animation: fadeIn 0.4s ease both; }
.anim-fade-in-up   { animation: fadeInUp 0.4s ease both; }
.anim-fade-in-down { animation: fadeInDown 0.4s ease both; }
.anim-slide-right  { animation: slideInRight 0.4s ease both; }
.anim-slide-left   { animation: slideInLeft 0.4s ease both; }
.anim-scale-in     { animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.anim-float        { animation: float 3s ease-in-out infinite; }
.anim-glow         { animation: glow 2s ease-in-out infinite; }

.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }

/* ────────────────────────────────────────────────────────────
   Page Transition
──────────────────────────────────────────────────────────── */
.page-enter {
  animation: fadeInUp 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ────────────────────────────────────────────────────────────
   Responsive Utilities
──────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .hide-lg { display: none !important; }
}
@media (max-width: 768px) {
  .hide-md { display: none !important; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hide-sm { display: none !important; }
  .fab { bottom: 20px; right: 20px; width: 52px; height: 52px; }
}

/* ────────────────────────────────────────────────────────────
   Misc helpers
──────────────────────────────────────────────────────────── */
.pointer   { cursor: pointer; }
.no-select { user-select: none; }
.truncate  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rounded   { border-radius: var(--radius-md); }
.rounded-full { border-radius: var(--radius-full); }
.shadow    { box-shadow: var(--shadow-md); }
.border    { border: 1px solid var(--border); }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.cursor-pointer { cursor: pointer; }

/* Notification dot */
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-card);
}

/* Status indicators */
.status-online  { background: var(--success); }
.status-away    { background: var(--warning); }
.status-busy    { background: var(--danger); }
.status-offline { background: var(--text-muted); }

.status-indicator {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--border);
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ────────────────────────────────────────────────────────────
   Color swatches for icon backgrounds
──────────────────────────────────────────────────────────── */
.ic-primary { background: var(--primary-subtle); color: var(--primary); }
.ic-success { background: var(--success-bg); color: var(--success); }
.ic-danger  { background: var(--danger-bg);  color: var(--danger); }
.ic-warning { background: var(--warning-bg); color: var(--warning); }
.ic-info    { background: var(--info-bg);    color: var(--info); }
.ic-purple  { background: var(--purple-bg);  color: var(--purple); }
