/* ============================================================
   AOTeam – Premium macOS-Inspired Design System
   ============================================================ */

/* ─── Custom Properties / Design Tokens ─────────────────── */
:root {
  /* Colors */
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #fafafa;
  --bg-sidebar: rgba(255, 255, 255, 0.72);
  --bg-topbar: rgba(255, 255, 255, 0.78);
  --bg-glass: rgba(255, 255, 255, 0.65);
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-hover: rgba(0, 0, 0, 0.03);
  --bg-active: rgba(99, 102, 241, 0.08);
  --bg-modal-overlay: rgba(0, 0, 0, 0.35);

  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-inverse: #ffffff;

  --accent: #6366f1;
  --accent-hover: #5558e6;
  --accent-light: rgba(99, 102, 241, 0.1);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  --success: #34c759;
  --success-bg: rgba(52, 199, 89, 0.1);
  --warning: #ff9f0a;
  --warning-bg: rgba(255, 159, 10, 0.1);
  --danger: #ff3b30;
  --danger-bg: rgba(255, 59, 48, 0.1);
  --info: #5ac8fa;
  --info-bg: rgba(90, 200, 250, 0.1);

  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.12);
  --border-accent: rgba(99, 102, 241, 0.3);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.14);
  --shadow-card-hover: 0 8px 24px rgba(99, 102, 241, 0.12);

  /* Typography */
  --font-family:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, monospace;

  --fs-xs: 0.6875rem; /* 11px */
  --fs-sm: 0.75rem; /* 12px */
  --fs-base: 0.8125rem; /* 13px */
  --fs-md: 0.875rem; /* 14px */
  --fs-lg: 1rem; /* 16px */
  --fs-xl: 1.25rem; /* 20px */
  --fs-2xl: 1.5rem; /* 24px */
  --fs-3xl: 1.875rem; /* 30px */

  /* 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;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 56px;
  --drawer-width: 380px;

  /* Transitions */
  --ease-spring: cubic-bezier(0.22, 0.68, 0, 1.2);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Z-Index */
  --z-sidebar: 100;
  --z-topbar: 90;
  --z-drawer: 110;
  --z-modal: 200;
  --z-toast: 300;
  --z-fab: 80;
}

/* ─── Reset & Base ──────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-md);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#app {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ─── Utility Classes ───────────────────────────────────── */
.hidden {
  display: none !important;
}
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: var(--sp-2);
}
.gap-3 {
  gap: var(--sp-3);
}
.gap-4 {
  gap: var(--sp-4);
}
.text-center {
  text-align: center;
}
.text-sm {
  font-size: var(--fs-sm);
}
.text-secondary {
  color: var(--text-secondary);
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.w-full {
  width: 100%;
}

/* ─── Glass Panels ──────────────────────────────────────── */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.glass-sidebar {
  background: var(--bg-sidebar);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--border);
}

.glass-topbar {
  background: var(--bg-topbar);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

/* ─── Auth Screens ──────────────────────────────────────── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  background: var(--bg-primary);
  background-image:
    radial-gradient(
      ellipse at 20% 50%,
      rgba(99, 102, 241, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(139, 92, 246, 0.06) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 80%,
      rgba(99, 102, 241, 0.04) 0%,
      transparent 50%
    );
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: var(--sp-10);
  box-shadow: var(--shadow-xl);
  animation: authSlideUp 0.6s var(--ease-out) both;
}

@keyframes authSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--sp-8);
}

.auth-logo .logo-icon {
  display: inline-flex;
  margin-bottom: var(--sp-4);
}

.auth-logo h1 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.auth-subtitle {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  margin-top: var(--sp-1);
}

/* ─── Forms ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--sp-5);
}

.form-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: var(--fs-md);
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-error {
  color: var(--danger);
  font-size: var(--fs-sm);
  margin-top: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
  text-align: center;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 20px;
  font-family: var(--font-family);
  font-size: var(--fs-md);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  will-change: transform, opacity;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
}

.btn-danger:hover {
  background: #e5342b;
}

.btn-success {
  background: var(--success);
  color: var(--text-inverse);
}

.btn-success:hover {
  background: #2db84e;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 8px 14px;
}

.btn-ghost:hover {
  background: var(--accent-light);
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--fs-sm);
  border-radius: 6px;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-group {
  display: flex;
  gap: var(--sp-2);
}

/* ─── App Shell Layout ──────────────────────────────────── */
#app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: width var(--duration-normal) var(--ease-smooth);
  overflow: hidden;
  flex-shrink: 0;
}

#sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  flex-shrink: 0;
  display: flex;
}

.sidebar-title {
  font-weight: 700;
  font-size: var(--fs-lg);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
}

#sidebar.collapsed .sidebar-title,
#sidebar.collapsed .user-details,
#sidebar.collapsed .nav-label,
#sidebar.collapsed .nav-badge {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3);
}

.nav-section {
  margin-bottom: var(--sp-4);
}

.nav-section-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-1);
}

#sidebar.collapsed .nav-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  will-change: transform, background;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.nav-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  flex: 1;
  transition: opacity var(--duration-fast);
}

.nav-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: var(--text-inverse);
  min-width: 20px;
  text-align: center;
  transition: opacity var(--duration-fast);
}

/* Sidebar Footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border);
}

.user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-weight: 700;
  font-size: var(--fs-sm);
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity var(--duration-fast);
}

.user-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-transform: capitalize;
}

/* ─── Main Content ──────────────────────────────────────── */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── Top Bar ───────────────────────────────────────────── */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  height: var(--topbar-height);
  z-index: var(--z-topbar);
  flex-shrink: 0;
}

.topbar-left h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.search-box {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 14px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-box svg {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  background: none;
  width: 200px;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  outline: none;
}

/* ─── Page Content ──────────────────────────────────────── */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-6);
  scroll-behavior: smooth;
}

.page-transition-enter {
  animation: pageEnter 0.3s var(--ease-out) both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-normal) var(--ease-smooth);
  will-change: transform, box-shadow;
}

.card:hover {
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.card-title {
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  transition: all var(--duration-normal) var(--ease-smooth);
  will-change: transform, box-shadow;
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.accent {
  background: var(--accent-light);
  color: var(--accent);
}
.stat-icon.success {
  background: var(--success-bg);
  color: var(--success);
}
.stat-icon.warning {
  background: var(--warning-bg);
  color: var(--warning);
}
.stat-icon.danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.stat-icon.info {
  background: var(--info-bg);
  color: var(--info);
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─── Status Pills ──────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: capitalize;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pill.assigned {
  background: var(--info-bg);
  color: #0891b2;
}
.status-pill.assigned::before {
  background: #0891b2;
}

.status-pill.distributed {
  background: rgba(168, 85, 247, 0.1);
  color: #7c3aed;
}
.status-pill.distributed::before {
  background: #7c3aed;
}

.status-pill.in_progress {
  background: var(--warning-bg);
  color: #d97706;
}
.status-pill.in_progress::before {
  background: #d97706;
}

.status-pill.pending_approval {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
}
.status-pill.pending_approval::before {
  background: var(--accent);
}

.status-pill.approved {
  background: var(--success-bg);
  color: #059669;
}
.status-pill.approved::before {
  background: #059669;
}

.status-pill.rejected {
  background: var(--danger-bg);
  color: var(--danger);
}
.status-pill.rejected::before {
  background: var(--danger);
}

/* ─── Data Table ────────────────────────────────────────── */
.data-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.data-table-toolbar .left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
}

.data-table-toolbar .right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--duration-fast);
}

.data-table thead th:hover {
  color: var(--text-primary);
}

.data-table tbody tr {
  transition: background var(--duration-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table tbody td {
  padding: 12px 16px;
  font-size: var(--fs-base);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.pagination-buttons {
  display: flex;
  gap: var(--sp-1);
}

.pagination-buttons button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: all var(--duration-fast);
}

.pagination-buttons button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.pagination-buttons button.active {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

/* ─── Task Card (for lists) ─────────────────────────────── */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-smooth);
  will-change: transform, box-shadow;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-accent);
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}

.task-card-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: var(--sp-2);
}

.task-card-meta svg {
  width: 12px;
  height: 12px;
}

.task-card.advance {
  border-left: 3px solid var(--info);
}

/* Task Cards Grid */
.task-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
}

/* ─── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  animation: modalOverlayIn 0.2s var(--ease-out) both;
}

.modal-overlay.hidden {
  display: none !important;
}

@keyframes modalOverlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-panel {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalPanelIn 0.35s var(--ease-spring) both;
}

@keyframes modalPanelIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.modal-body {
  padding: var(--sp-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
}

/* ─── Drawer (Inspector Panel) ──────────────────────────── */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform var(--duration-normal) var(--ease-smooth);
}

.drawer.hidden {
  transform: translateX(100%);
  display: flex !important;
  pointer-events: none;
}

.drawer:not(.hidden) {
  pointer-events: all;
  animation: drawerSlideIn 0.3s var(--ease-out) both;
}

@keyframes drawerSlideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-height);
}

.drawer-header h3 {
  font-size: var(--fs-md);
  font-weight: 700;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5);
}

/* ─── Toast ─────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-base);
  font-weight: 500;
  pointer-events: all;
  animation: toastIn 0.35s var(--ease-spring) both;
  max-width: 380px;
}

.toast.removing {
  animation: toastOut 0.25s var(--ease-smooth) both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.95);
  }
  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.95);
  }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success {
  border-left: 3px solid var(--success);
}
.toast.success .toast-icon {
  color: var(--success);
}
.toast.error {
  border-left: 3px solid var(--danger);
}
.toast.error .toast-icon {
  color: var(--danger);
}
.toast.warning {
  border-left: 3px solid var(--warning);
}
.toast.warning .toast-icon {
  color: var(--warning);
}
.toast.info {
  border-left: 3px solid var(--info);
}
.toast.info .toast-icon {
  color: var(--info);
}

/* ─── File Dropzone ─────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--sp-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  background: var(--bg-tertiary);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.dropzone-icon {
  margin-bottom: var(--sp-3);
  color: var(--text-tertiary);
}

.dropzone-text {
  font-size: var(--fs-base);
  color: var(--text-secondary);
}

.dropzone-hint {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: var(--sp-1);
}

.proof-preview {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.proof-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.proof-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proof-thumb .remove-proof {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

/* ─── FAB ───────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-8);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: var(--text-inverse);
  border: none;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  z-index: var(--z-fab);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal) var(--ease-spring);
  will-change: transform;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.45);
}

.fab:active {
  transform: scale(0.95);
}

/* ─── Skeleton Loading ──────────────────────────────────── */
.skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.skeleton-card {
  height: 120px;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-lg);
}

.skeleton-row {
  height: 48px;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ─── Empty State ───────────────────────────────────────── */
.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: 64px;
  height: 64px;
  margin-bottom: var(--sp-4);
  color: var(--text-tertiary);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.empty-state-text {
  font-size: var(--fs-base);
  color: var(--text-tertiary);
  max-width: 320px;
}

/* ─── Drag & Drop (Leader Distribute) ───────────────────── */
.distribute-board {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-4);
  min-height: 400px;
}

.distribute-column {
  flex: 0 0 280px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}

.distribute-column-header {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: var(--fs-base);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.distribute-column-header .count {
  font-size: var(--fs-xs);
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.distribute-column-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-height: 100px;
}

.distribute-column-body.drag-over {
  background: var(--accent-light);
  border-radius: var(--radius-md);
}

.draggable-task {
  cursor: grab;
  user-select: none;
}

.draggable-task:active {
  cursor: grabbing;
}

.draggable-task.dragging {
  opacity: 0.5;
  transform: scale(0.97);
}

.drag-placeholder {
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  min-height: 60px;
  background: var(--accent-light);
}

/* ─── Proof Gallery ─────────────────────────────────────── */
.proof-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--sp-3);
}

.proof-gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.proof-gallery-item:hover {
  border-color: var(--accent);
  transform: scale(1.03);
}

.proof-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Proof lightbox */
.proof-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proof-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.proof-lightbox .close-lightbox {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--sp-1);
  padding: var(--sp-1);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-6);
}

.tab {
  padding: 8px 16px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

/* ─── Section Header ────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.section-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ─── Filter Bar ────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  width: auto;
  min-width: 140px;
  padding: 7px 12px;
  font-size: var(--fs-sm);
}

/* ─── Rejection Reason ──────────────────────────────────── */
.rejection-banner {
  background: var(--danger-bg);
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
}

.rejection-banner strong {
  color: var(--danger);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    z-index: 200;
  }
  #sidebar.mobile-open {
    transform: translateX(0);
  }
  .topbar-left {
    order: 2;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .distribute-board {
    flex-direction: column;
  }
  .distribute-column {
    flex: none;
    width: 100%;
  }
}
