/* ─────────────────────────────────────────────────────────
   DESIGN SYSTEM — HRM-v2 by TheQuantumix
   Font: Plus Jakarta Sans
   Accent: Indigo-violet gradient
   ───────────────────────────────────────────────────────── */

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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Tabler icon webfont — consistent alignment everywhere icons are used */
.ti {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

:root {
  /* ── Brand Colors ── */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* ── Semantic Colors ── */
  --success: #10b981;
  --success-bg: #d1fae5;
  --success-text: #065f46;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --info-text: #1e40af;

  /* ── Neutrals (Slate-based) ── */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --black: #000000;

  /* ── Typography ── */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* ── Font Sizes (fluid via clamp) ── */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: clamp(1.25rem, 3vw, 1.5rem);
  --text-3xl: clamp(1.5rem, 4vw, 1.875rem);
  --text-4xl: clamp(1.75rem, 5vw, 2.25rem);

  /* ── Spacing ── */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* ── Border Radius ── */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.18);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.06);

  /* ── Z-Index Scale ── */
  --z-below: -1;
  --z-base: 0;
  --z-raised: 10;
  --z-dropdown: 200;
  --z-sticky: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-toast: 700;
  --z-navbar: 100;
  --z-sidebar: 100;

  /* ── Layout ── */
  --navbar-height: 80px;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 60px;
  --sidebar-tablet-width: 220px;
  --content-max-width: 1440px;

  /* ── Transitions ── */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────────────────
   BASE
   ───────────────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-800);
  background:
    radial-gradient(circle at 0% 0%, #f3f0ff 0%, transparent 50%),
    radial-gradient(circle at 100% 0%, #fff1f2 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, #e0f2fe 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, #fdf4ff 0%, transparent 50%),
    #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--primary-dark);
}

/* ─────────────────────────────────────────────────────────
   LAYOUT UTILITIES
   ───────────────────────────────────────────────────────── */

.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.page-wrapper {
  padding: var(--spacing-xl);
  max-width: var(--content-max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .page-wrapper {
    padding: var(--spacing-md);
  }
}

/* ─────────────────────────────────────────────────────────
   BUTTONS  (min 44px touch target — WCAG 2.5.5)
   ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.45);
}

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

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--gray-800);
}

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

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.22);
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
  transform: translateY(-1px);
}

.btn-info {
  background: var(--info);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-info:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-outline:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-300);
}

.btn-outline-danger:hover:not(:disabled) {
  background: var(--danger-50);
  border-color: var(--danger-400);
}


.btn-link {
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  box-shadow: none;
}

.btn-link:hover:not(:disabled) {
  background: transparent;
  color: var(--primary-dark);
  text-decoration: underline;
  transform: none;
}

/* Sizes */
.btn-sm {
  min-height: 36px;
  padding: 0.375rem 0.875rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  min-height: 52px;
  padding: 0.875rem 1.75rem;
  font-size: var(--text-base);
}

.btn-icon {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
  min-height: 36px;
  min-width: 36px;
}

/* ─────────────────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
}

.card-sm {
  padding: var(--spacing-md);
}

.card-lg {
  padding: var(--spacing-xl);
}

/* ─────────────────────────────────────────────────────────
   BADGES
   ───────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

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

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

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

.badge-info {
  background: var(--info-bg);
  color: var(--info-text);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ─────────────────────────────────────────────────────────
   FORM ELEMENTS
   ───────────────────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}

.form-label .required {
  color: var(--danger);
  margin-left: 0.125rem;
}

.form-control,
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--gray-800);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.form-control::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-400);
}

.form-control:disabled,
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--gray-50);
  color: var(--gray-400);
  cursor: not-allowed;
}

.form-control.error,
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

.form-error {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--danger);
  font-size: var(--text-xs);
  margin-top: 0.25rem;
}

.form-hint {
  color: var(--gray-500);
  font-size: var(--text-xs);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Code input + generate button */
.code-input-group {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.code-input-group .code-input {
  flex: 1;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-right: none !important;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  background: #f8f9ff;
  border: 1px solid #d1d5db;
  border-left: 1px solid #e5e7eb;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  color: #667eea;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  font-family: var(--font-sans);
}

.btn-generate:hover {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}

.btn-generate:active {
  transform: scale(0.97);
}

.btn-generate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f3f4f6;
}

/* ─────────────────────────────────────────────────────────
   TABLES
   ───────────────────────────────────────────────────────── */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

@media (max-width: 768px) {
  .table-wrap {
    border-radius: var(--radius-md);
  }
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gray-500);
  background: var(--gray-50);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.table td {
  padding: 0.875rem 1rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

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

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

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

/* ─────────────────────────────────────────────────────────
   ALERTS
   ───────────────────────────────────────────────────────── */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.5;
  border: 1px solid transparent;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #a7f3d0;
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: #fde68a;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: #fecaca;
}

.alert-info {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: #bfdbfe;
}

/* ─────────────────────────────────────────────────────────
   MODALS
   ───────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--spacing-md);
  animation: fadeIn var(--transition-base) ease;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-2xl);
  width: calc(100% - 32px);
  max-width: 560px;
  max-height: calc(100vh - 2 * var(--spacing-md));
  overflow-y: auto;
  animation: slideUp var(--transition-slow);
}

.modal-box-sm {
  max-width: 400px;
}

.modal-box-lg {
  max-width: 720px;
}

.modal-box-xl {
  max-width: 900px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--gray-200);
}

/* ─────────────────────────────────────────────────────────
   LOADING SPINNER
   ───────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  border: 2px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 1rem;
  height: 1rem;
}

.spinner-lg {
  width: 2.5rem;
  height: 2.5rem;
  border-width: 3px;
}

.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: var(--spacing-2xl);
  color: var(--gray-500);
  font-size: var(--text-sm);
}

/* ─────────────────────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: var(--spacing-2xl) var(--spacing-xl);
  text-align: center;
  color: var(--gray-400);
}

.empty-state p {
  font-size: var(--text-sm);
  max-width: 32ch;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────
   PAGE HEADER
   ───────────────────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
}

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

.page-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: 0.125rem;
}

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header-left {
    width: 100%;
  }
}

/* ─────────────────────────────────────────────────────────
   STATUS CHIPS
   ───────────────────────────────────────────────────────── */

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

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

/* ── Core states ────────────────────────────────────────── */
.status-pending {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-approved {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-rejected {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.status-cancelled {
  background: var(--gray-100);
  color: var(--gray-500);
}

.status-draft {
  background: var(--gray-100);
  color: var(--gray-600);
}

.status-submitted {
  background: var(--info-bg);
  color: var(--info-text);
}

.status-processing {
  background: #fef3c7;
  color: #b45309;
}

.status-finalized {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.status-active {
  background: var(--info-bg);
  color: var(--info-text);
}

.status-inactive {
  background: var(--gray-100);
  color: var(--gray-500);
}

/* ── Lead & CRM statuses ── */
.status-new {
  background: var(--gray-100);
  color: var(--gray-600);
}

.status-new_lead {
  background: var(--gray-100);
  color: var(--gray-600);
}

.status-contacted {
  background: var(--info-bg);
  color: var(--info-text);
}

.status-follow_up,
.status-follow-up {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-interested {
  background: #ede9fe;
  color: #5b21b6;
}

.status-negotiation {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-proposal_sent {
  background: var(--info-bg);
  color: var(--info-text);
}

.status-qualified {
  background: #d1fae5;
  color: #065f46;
}

.status-converted {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.status-lost {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.status-not_interested {
  background: var(--gray-100);
  color: var(--gray-500);
}

/* ── Project statuses ── */
.status-planning {
  background: var(--gray-100);
  color: var(--gray-600);
}

.status-assigned {
  background: var(--info-bg);
  color: var(--info-text);
}

.status-on-hold {
  background: var(--gray-100);
  color: var(--gray-500);
}

.status-testing {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-completed {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-delivered {
  background: #d1fae5;
  color: #065f46;
}

.status-archived {
  background: var(--gray-100);
  color: var(--gray-400);
}

/* ── Finance statuses ── */
.status-paid {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-partial {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-sent {
  background: var(--info-bg);
  color: var(--info-text);
}

.status-overdue {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.status-viewed {
  background: var(--info-bg);
  color: var(--info-text);
}

/* ── Task & Operations Board ── */
.status-to-do {
  background: var(--gray-100);
  color: var(--gray-600);
}

.status-in-progress {
  background: var(--info-bg);
  color: var(--info-text);
}

.status-review {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-done {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-planned {
  background: var(--gray-100);
  color: var(--gray-600);
}

.status-delayed {
  background: var(--danger-bg);
  color: var(--danger-text);
}

/* ── Social media calendar ── */
.status-designing {
  background: #ede9fe;
  color: #5b21b6;
}

.status-scheduled {
  background: var(--info-bg);
  color: var(--info-text);
}

.status-published {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-missed {
  background: var(--danger-bg);
  color: var(--danger-text);
}

/* ── Subscription / HR ── */
.status-paused {
  background: var(--gray-100);
  color: var(--gray-500);
}

.status-expired {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.status-present {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-absent {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.status-half-day {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-leave {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ─────────────────────────────────────────────────────────
   DIVIDERS
   ───────────────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: var(--gray-200);
  border: none;
  margin: var(--spacing-lg) 0;
}

/* ─────────────────────────────────────────────────────────
   SCROLL
   ───────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ─────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────── */

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes spin-once {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ─────────────────────────────────────────────────────────
   MOBILE UTILITIES
   ───────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 641px) {
  .show-mobile-only {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .hide-tablet {
    display: none !important;
  }
}

/* ─────────────────────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─────────────────────────────────────────────────────────
   FORM PAGES — full-width (New / Edit / Create / Update)
   .of-page is the shared form container used across modules
   ───────────────────────────────────────────────────────── */

.of-page {
  max-width: none !important;
}

/* ─────────────────────────────────────────────────────────
   SHARED DELETE CONFIRMATION MODAL
   Used by showDeleteConfirm() / showConfirm() in store.js
   ───────────────────────────────────────────────────────── */

.hrm-del-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: calc(var(--z-modal) + 50);
  /* above any existing modals */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn var(--transition-base) ease;
}

.hrm-del-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: min(440px, calc(100vw - 2rem));
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  animation: slideUp var(--transition-slow);
}

.hrm-del-ico {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--danger-bg);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.hrm-del-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0 0 0.625rem;
  line-height: 1.3;
}

.hrm-del-body {
  font-size: var(--text-sm);
  color: var(--gray-500);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.hrm-del-body strong {
  color: var(--gray-800);
}

.hrm-del-inp {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: 0.08em;
  text-align: center;
  background: var(--gray-50);
  margin-bottom: 1.25rem;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.hrm-del-inp:focus {
  outline: none;
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
  background: var(--white);
}

.hrm-del-btns {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.hrm-del-btns .btn {
  flex: 1;
  justify-content: center;
}

/* ─────────────────────────────────────────────────────────
   HIGH CONTRAST
   ───────────────────────────────────────────────────────── */

@media (prefers-contrast: high) {
  .btn {
    border-width: 2px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    border-width: 2px;
  }
}

/* ═══════════════════════════════════════════════════════════
   SPA LAYOUT — Sidebar + Navbar + Content
   ═══════════════════════════════════════════════════════════ */

/* ── App shell ───────────────────────────────────────────── */

#app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(233, 233, 233, 0.5);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-slow);
  overflow: hidden;

}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

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

.sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

/* Sidebar header */
.sidebar-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.25rem;
  flex-shrink: 0;
}

.sidebar-header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  min-width: 0;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .sidebar-brand-name {
  opacity: 0;
  width: 0;
  overflow: hidden;
  margin: 0;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  background: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.sidebar-brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  transition: opacity var(--transition-base), width var(--transition-base);
}

.sidebar-collapse-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  transition: color var(--transition-base);
}

.sidebar-collapse-btn:hover {
  color: #6366f1;
}

.sidebar-collapse-btn .icon-expand {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn .icon-collapse {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn .icon-expand {
  display: flex;
}

.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 0;
  gap: 6px;
}

.sidebar.collapsed .sidebar-header-brand {
  overflow: visible;
}

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-md);
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-section:first-child {
  margin-bottom: 28px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  margin-bottom: 4px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-section-label {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
}

.nav-list {
  list-style: none;
  /*padding: 0 0.5rem;*/
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: #64748b;
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #64748b;
}

.nav-link:active {
  transform: scale(0.98);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.6);
  color: #1e293b;
  font-weight: 700;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.nav-link.active .nav-icon {
  color: #6366f1;
}

.nav-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  transition: transform var(--transition-fast);
}

.nav-link:hover .nav-icon {
  transform: scale(1.07);
}

.nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--transition-base), width var(--transition-base);
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  width: 0;
  margin: 0;
}

.sidebar.collapsed .nav-link {
  /*justify-content: center; padding: 9px; */
}

/* Collapsed tooltips */
.sidebar.collapsed .nav-link::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  background: var(--gray-900);
  color: white;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  z-index: var(--z-popover);
  box-shadow: var(--shadow-lg);
}

.sidebar.collapsed .nav-link:hover::after {
  opacity: 1;
}

/* Sub-menu */
.nav-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow);
}

.nav-sub.open {
  max-height: 400px;
}

.nav-sub-list {
  list-style: none;
  padding: 2px 0 4px 0;
  margin-left: 21px;
  border-left: 2px solid var(--gray-200);
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-sub-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  font-size: var(--text-xs);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
}

.nav-sub-link:hover {
  color: #6366f1;
  background: none;
}

.nav-sub-link.active {
  color: #6366f1;
  font-weight: 600;
  background: none;
}

.nav-chevron {
  margin-left: auto;
  transition: transform var(--transition-base);
  flex-shrink: 0;
  color: var(--gray-400);
}

.nav-item.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-link:hover .nav-chevron {
  color: var(--gray-600);
}

.sidebar.collapsed .nav-chevron {
  display: none;
}

/* Sidebar footer */
.sidebar-footer {
  position: relative;
  padding: 0.75rem;
  border-top: 1px solid rgba(243, 244, 246, 0.5);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.625rem 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .sidebar-user-info {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-user-name {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  display: block;
  font-size: 0.65rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-chevron {
  flex-shrink: 0;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  transition: transform var(--transition-base);
}

.sidebar-user-chevron.open {
  transform: rotate(90deg);
}

.sidebar.collapsed .sidebar-user-chevron {
  display: none;
}

/* Sidebar user popup menu */
.sb-user-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 8px;
  right: 8px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-popover);
  overflow: hidden;
  animation: nb-drop-in 0.15s ease;
}

.sb-user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--gray-50);
}

.sb-user-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sb-user-menu-name {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-user-menu-email {
  font-size: 0.65rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-user-menu-divider {
  height: 1px;
  background: var(--gray-100);
}

.sb-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--gray-700);
  text-align: left;
  transition: background 0.1s;
}

.sb-menu-item:hover {
  background: var(--gray-50);
}

.sb-menu-logout {
  color: var(--danger);
}

.sb-menu-logout:hover {
  background: var(--danger-bg);
}

/* Sidebar backdrop — mobile only */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: calc(var(--z-sidebar) - 1);
}

.sidebar-backdrop.visible {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Mobile sidebar */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
    z-index: calc(var(--z-sidebar) + 5);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .sidebar-collapse-btn {
    display: none;
  }
}

/* Tablet sidebar */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-tablet-width);
  }

  .sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
  }
}

@media (prefers-contrast: high) {
  .sidebar {
    border-right: 2px solid #000;
  }

  .nav-link.active {
    background: #000 !important;
    color: #fff !important;
  }
}

@media (prefers-reduced-motion: reduce) {

  .sidebar,
  .nav-link,
  .sidebar-collapse-btn,
  .nav-icon,
  .nav-label,
  .nav-section {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Layout container ────────────────────────────────────── */

/* ── App shell layout ──────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

@media (max-width: 768px) {
  .content-area {
    margin-left: 0 !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .content-area.collapsed {
    margin-left: 0;
  }
}

/* ── Top navbar ──────────────────────────────────────────── */

.navbar {
  height: var(--navbar-height);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(233, 233, 233, 0.5);
  z-index: var(--z-navbar);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.navbar-accent {
  display: none;
}

.navbar-left {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nb-welcome {
  display: flex;
  flex-direction: column;
}

.nb-welcome-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.2;
  margin: 0;
}

.nb-welcome-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  margin: 0;
}

.nb-icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #fcfcfc;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 9999px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.nb-icon-btn:hover {
  background: rgba(255, 255, 255, 1);
  color: #6366f1;
}

.navbar-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--gray-500);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.navbar-hamburger:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

/* Brand */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  user-select: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(102, 126, 234, .35);
}

.brand-q {
  font-size: 0.875rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}

.brand-name {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--gray-400);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-avatar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.navbar-avatar-btn:hover {
  background: var(--gray-100);
}

.navbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}

.navbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Divider between navbar items ── */
.nb-divider {
  width: 1px;
  height: 20px;
  background: var(--gray-200);
  flex-shrink: 0;
  margin: 0 0.25rem;
}

/* ═══════════════════════════════════════════════════════════
   NOTIFICATION BELL
   ═══════════════════════════════════════════════════════════ */
.nb-bell-wrap {
  position: relative;
}

.nb-bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid #fcfcfc;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nb-bell-btn:hover,
.nb-bell-active {
  background: rgba(255, 255, 255, 1);
  color: #6366f1;
}

.nb-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 2px solid #fff;
  border-radius: var(--radius-full);
}

.nb-badge-dot {
  width: 8px;
  height: 8px;
  background: #ec4899;
  top: 10px;
  right: 10px;
}

.nb-badge-high {
  background: #ef4444;
}

.nb-badge-normal {
  background: #ef4444;
}

.nb-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: #fff;
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 14px;
  box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(99, 102, 241, 0.04);
  z-index: var(--z-popover);
  overflow: hidden;
  animation: nb-drop-in 0.18s ease;
}

@keyframes nb-drop-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nb-dropdown-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.nb-dropdown-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -0.01em;
}

.nb-count-chip {
  background: #6366f1;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.nb-close {
  margin-left: auto;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}

.nb-close:hover {
  color: var(--gray-700);
  background: var(--gray-100);
}

.nb-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.8125rem;
}

.nb-empty-icon {
  margin: 0 auto 8px;
  opacity: 0.35;
}

.nb-list {
  max-height: 380px;
  overflow-y: auto;
}

.nb-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-50);
  transition: background 0.1s;
}

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

.nb-item:hover {
  background: var(--gray-50);
}

.nb-item-high {
  border-left: 3px solid #ef4444;
}

.nb-item-medium {
  border-left: 3px solid #f59e0b;
}

.nb-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.nb-icon-subscription {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.nb-icon-invoice {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.nb-icon-task {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

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

.nb-item-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nb-item-msg {
  font-size: 0.8125rem;
  color: var(--gray-800);
  margin-top: 2px;
  line-height: 1.4;
}

.nb-item-date {
  font-size: 0.6875rem;
  color: var(--gray-400);
  margin-top: 4px;
}

/* Notification dropdown footer */
.nb-dropdown-footer {
  border-top: 1px solid var(--gray-100);
  padding: 10px 16px;
  text-align: center;
}

.nb-view-all {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6366f1;
  text-decoration: none;
}

.nb-view-all:hover {
  text-decoration: underline;
}

/* ── Global Search ──────────────────────────────────────── */
.nb-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 30rem;
  margin: 0 auto;
}

.nb-search-ico {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.nb-search-input {
  width: 100%;
  padding: 0.625rem 5rem 0.625rem 2.5rem;
  border: 1px solid #fcfcfc;
  border-radius: 0.75rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.75rem;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.85);
  outline: none;
  transition: background 0.15s, box-shadow 0.15s;
}

.nb-search-input:focus {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  background: rgba(255, 255, 255, 0.8);
}

.nb-search-input::placeholder {
  color: #94a3b8;
}

.nb-search-kbd-wrap {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.nb-kbd {
  font-size: 0.6875rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  color: #94a3b8;
  line-height: 1.4;
  background: transparent;
}

.nb-search-drop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 380px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 700;
  max-height: 480px;
  overflow-y: auto;
}

.nb-srch-group {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.nb-srch-group:last-child {
  border-bottom: none;
}

.nb-srch-group-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--gray-400);
  text-transform: uppercase;
  padding: 0.375rem 1rem 0.25rem;
}

.nb-srch-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.1s;
  flex-wrap: wrap;
}

.nb-srch-item:hover {
  background: var(--gray-50);
}

.nb-srch-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-900);
  flex: 1;
  min-width: 0;
}

.nb-srch-sub {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.nb-srch-status {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--gray-600);
  text-transform: capitalize;
  margin-left: auto;
}

.nb-srch-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════
   USER CHIP + DROPDOWN
   ═══════════════════════════════════════════════════════════ */
.nb-user-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3125rem 0.625rem 0.3125rem 0.3125rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nb-user-chip:hover {
  background: rgba(99, 102, 241, 0.06);
}

.nb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.35);
  overflow: hidden;
}

.nb-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nb-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.nb-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.nb-role-pill {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  line-height: 1.5;
  white-space: nowrap;
}

.nb-role-admin {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}

.nb-role-manager {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.nb-role-accounts {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.nb-role-employee {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
}

.nb-chevron {
  color: var(--gray-400);
  transition: transform 0.2s ease, color 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.nb-chevron.open {
  transform: rotate(180deg);
  color: #6366f1;
}

.nb-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: #fff;
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 14px;
  box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(99, 102, 241, 0.04);
  z-index: var(--z-popover);
  overflow: hidden;
  animation: nb-drop-in 0.18s ease;
}

.nb-user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
}

.nb-user-menu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.nb-user-menu-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.nb-user-menu-email {
  font-size: 0.6875rem;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  margin-top: 1px;
}

.nb-user-menu-divider {
  height: 1px;
  background: var(--gray-100);
}

.nb-user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
  text-align: left;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
}

.nb-user-menu-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.nb-user-menu-logout {
  color: #ef4444;
}

.nb-user-menu-logout:hover {
  background: rgba(239, 68, 68, 0.05);
  color: #dc2626;
}

@media (max-width: 560px) {
  .nb-user-chip {
    padding: 0.3125rem;
  }

  .nb-chevron {
    display: none;
  }

  .nb-user-menu {
    right: -8px;
    width: 200px;
  }

  .nb-dropdown {
    width: calc(100vw - 24px);
    right: -8px;
  }
}

/* ── Page content ────────────────────────────────────────── */

.page-content {
  flex: 1;
  position: relative;
  background: #ffffff;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE — ANIMATED
   ═══════════════════════════════════════════════════════════ */

.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  overflow: hidden;
  background:
    radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(118, 75, 162, 0.18) 0%, transparent 50%),
    var(--gray-50);
  transition: background 0.4s ease;
}

.login-page[data-theme="dark"] {
  background:
    radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.28) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(118, 75, 162, 0.28) 0%, transparent 50%),
    #0f0f1a;
}

/* Particle canvas */
.login-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Theme toggle button */
.login-theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  color: var(--gray-600);
}

.login-theme-toggle:hover {
  transform: rotate(20deg) scale(1.1);
}

.login-page[data-theme="dark"] .login-theme-toggle {
  background: rgba(30, 30, 50, 0.9);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fbbf24;
}

/* Card */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: loginCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-page[data-theme="dark"] .login-card {
  background: rgba(20, 20, 40, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

@media (prefers-reduced-motion: reduce) {
  .login-card { animation: none; }
}

/* Logo */
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.login-logo-icon {
  width: 52px;
  height: 52px;
  background: var(--primary-gradient);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.login-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--gray-900);
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
  transition: color 0.3s ease;
}

.login-page[data-theme="dark"] .login-title {
  color: #f1f5f9;
}

.login-subtitle {
  font-size: var(--text-sm);
  color: var(--gray-500);
  text-align: center;
  margin-bottom: 2rem;
  transition: color 0.3s ease;
}

.login-page[data-theme="dark"] .login-subtitle {
  color: #64748b;
}

/* Floating label fields */
.login-field-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.login-field-wrap input {
  width: 100%;
  min-height: 56px;
  padding: 1.375rem 0.875rem 0.5rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.login-field-wrap input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.login-field-wrap input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.login-page[data-theme="dark"] .login-field-wrap input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

.login-page[data-theme="dark"] .login-field-wrap input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.login-float-label {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-base);
  color: var(--gray-400);
  pointer-events: none;
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              font-size 0.2s ease,
              color 0.2s ease;
  background: transparent;
}

.login-field-wrap.active .login-float-label {
  top: 0.55rem;
  transform: none;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.03em;
}

.login-field-wrap.invalid .login-float-label {
  color: var(--danger);
}

.login-page[data-theme="dark"] .login-float-label {
  color: #475569;
}

.login-page[data-theme="dark"] .login-field-wrap.active .login-float-label {
  color: #818cf8;
}

/* Field error */
.login-field-error {
  display: none;
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: 0.3rem;
  padding-left: 0.125rem;
}

/* Password toggle (within login-field-wrap) */
.login-field-wrap .password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
  z-index: 2;
}

.login-field-wrap .password-toggle:hover {
  color: var(--gray-600);
}

.login-page[data-theme="dark"] .login-field-wrap .password-toggle {
  color: #475569;
}

.login-page[data-theme="dark"] .login-field-wrap .password-toggle:hover {
  color: #94a3b8;
}

/* Also keep password-wrapper for backwards compat */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.password-toggle:hover {
  color: var(--gray-600);
}

/* Form options row */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: var(--text-sm);
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--gray-600);
  user-select: none;
}

.login-remember input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.login-forgot {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.login-forgot:hover {
  text-decoration: underline;
}

.login-page[data-theme="dark"] .login-remember {
  color: #94a3b8;
}

.login-page[data-theme="dark"] .login-forgot {
  color: #818cf8;
}

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  font-size: var(--text-xs);
  color: var(--gray-400);
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.login-page[data-theme="dark"] .login-divider {
  color: #334155;
}

.login-page[data-theme="dark"] .login-divider::before,
.login-page[data-theme="dark"] .login-divider::after {
  background: rgba(255, 255, 255, 0.08);
}

/* Buttons */
.login-btn {
  width: 100%;
  min-height: 48px;
  font-size: var(--text-base);
  font-weight: 700;
}

.login-register-btn {
  width: 100%;
}

.login-page[data-theme="dark"] .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-page[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Footer */
.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: var(--text-xs);
  color: var(--gray-400);
}

.login-page[data-theme="dark"] .login-footer {
  color: #334155;
}

/* Alert in dark mode */
.login-page[data-theme="dark"] .alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* Portal login specifics */
.portal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--gray-500);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.2s ease;
}

.portal-back-link:hover {
  color: var(--gray-700);
}

.login-page[data-theme="dark"] .portal-back-link {
  color: #475569;
}

.login-page[data-theme="dark"] .portal-back-link:hover {
  color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + 0.75rem);
  right: 1rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideInRight var(--transition-base) ease;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  pointer-events: all;
  border: 1px solid transparent;
}

.toast-success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.toast-danger {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.toast-warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.toast-info {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.toast-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  margin-bottom: 0.125rem;
}

.toast-message {
  opacity: 0.85;
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
  transition: opacity var(--transition-fast);
}

.toast-close:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD STAT CARDS
   ═══════════════════════════════════════════════════════════ */

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.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(--text-3xl);
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.stat-delta {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-delta-up {
  color: var(--success);
}

.stat-delta-down {
  color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════════════════════════ */

.search-bar {
  position: relative;
  max-width: 320px;
}

.search-bar-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

.search-bar input {
  padding-left: 2.25rem;
  padding-right: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: var(--spacing-lg);
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--gray-900);
}

.pagination-btn.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   DROPDOWN MENU
   ═══════════════════════════════════════════════════════════ */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 180px;
  z-index: var(--z-popover);
  animation: slideDown var(--transition-base);
  overflow: hidden;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
  color: var(--gray-700);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--gray-50);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 0.25rem 0;
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD — EXTENDED LAYOUT & WIDGETS
   ═══════════════════════════════════════════════════════════ */

/* Flush card for dashboard widgets (header + table go edge-to-edge) */
.dash-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* Strip inner border from table-wrap when inside a dash-card */
.dash-card .table-wrap {
  border: none;
  border-radius: 0;
}

/* Stat grid — auto-fit responsive columns */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Stat card icon slot (matches the inline style pattern in dashboard.js) */
.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

/* Trend indicator below stat value */
.stat-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: 0.25rem;
}

.stat-trend-up {
  color: var(--success);
}

.stat-trend-dn {
  color: var(--danger);
}

/* Two-column responsive grid for widget pairs */
.dash-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Card header used in dashboard widget cards */
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}

.dash-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: 0.01em;
}

/* Quick-actions strip */
.dash-qa-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 0.875rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.dash-qa-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.dash-qa-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dash-qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.dash-qa-btn svg {
  flex-shrink: 0;
}

/* Task status row widget */
.task-status-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem;
}

.task-status-cell {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 1rem 0.5rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}

.task-status-num {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1;
}

.task-status-lbl {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: 0.375rem;
}

/* Activity feed list */
.activity-list {
  max-height: 320px;
  overflow-y: auto;
}

.activity-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-50);
  font-size: var(--text-sm);
}

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

.activity-desc {
  flex: 1;
  color: var(--gray-700);
}

.activity-time {
  flex-shrink: 0;
  color: var(--gray-400);
  font-size: var(--text-xs);
  white-space: nowrap;
}

/* Employee dashboard — my tasks list */
.my-task-list {
  padding: 0.25rem 0;
  max-height: 340px;
  overflow-y: auto;
}

.my-task-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--gray-50);
}

.my-task-row:last-child {
  border-bottom: none;
}

.my-task-title {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Status chips — task statuses (mapped from hyphenated values) */
.status-chip.status-todo {
  background: var(--gray-100);
  color: var(--gray-600);
}

.status-chip.status-inprogress {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-chip.status-review {
  background: var(--info-bg);
  color: var(--info);
}

.status-chip.status-done {
  background: var(--success-bg);
  color: var(--success);
}

/* Dashboard card spacing below widget groups */
.dash-two-col+.card,
.stat-grid+.card {
  margin-bottom: 1.5rem;
}

.card+.card {
  margin-top: 1.5rem;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .stat-card {
    transition: none;
  }

  .stat-card:hover {
    transform: none;
  }
}

/* ─────────────────────────────────────────────────────────
   PROFILE SETTINGS  (profile.js)
   ───────────────────────────────────────────────────────── */

.ps-page {
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.ps-header {
  margin-bottom: 1.5rem;
}

.ps-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 768px) {
  .ps-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Identity Card ── */

.ps-identity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  gap: 1rem;
}

.ps-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.ps-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(102, 126, 234, .35);
}

.ps-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ps-avatar-initials {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.ps-avatar-edit {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  transition: all var(--transition-fast);
}

.ps-avatar-edit:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.ps-identity-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .375rem;
}

.ps-identity-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.ps-role-badge {
  display: inline-block;
  padding: .2rem .75rem;
  background: rgba(99, 102, 241, .1);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ps-identity-desig {
  font-size: .8125rem;
  color: var(--gray-500);
}

.ps-identity-code {
  font-size: .8125rem;
  font-family: var(--font-mono);
  color: var(--gray-400);
  background: var(--gray-100);
  padding: .125rem .5rem;
  border-radius: var(--radius-sm);
}

.ps-identity-meta {
  width: 100%;
  border-top: 1px solid var(--gray-100);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.ps-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}

.ps-meta-label {
  font-size: .75rem;
  color: var(--gray-400);
  font-weight: 500;
  flex-shrink: 0;
}

.ps-meta-value {
  font-size: .8125rem;
  color: var(--gray-700);
  font-weight: 500;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Main Card & Tabs ── */

.ps-main-card {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  padding: 0;
  /* override .card padding — tabs & content handle their own spacing */
  overflow: hidden;
  /* keep border-radius on child edges */
}

.ps-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 .25rem;
}

.ps-tab {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .9375rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  margin-bottom: -1px;
  white-space: nowrap;
}

.ps-tab:hover {
  color: var(--gray-800);
}

.ps-tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.ps-tab-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex: 1;
}

/* ── Form Sections ── */

.ps-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ps-section-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gray-400);
}

.ps-section-desc {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: -.5rem;
}

.ps-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .875rem;
}

.ps-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: .875rem;
  max-width: 480px;
}

.ps-field {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.ps-field-full {
  grid-column: 1 / -1;
}

.ps-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-700);
}

.ps-input {
  height: 40px;
  padding: 0 .75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

select.ps-input {
  padding-right: 2rem;
}

textarea.ps-input {
  height: auto;
  padding: .625rem .75rem;
  resize: vertical;
}

.ps-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.ps-input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
}

.ps-input-wrap {
  position: relative;
}

.ps-input-wrap .ps-input {
  padding-right: 2.5rem;
}

.ps-eye {
  position: absolute;
  right: .625rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: .25rem;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.ps-eye:hover {
  color: var(--gray-700);
}

.ps-error {
  font-size: var(--text-xs);
  color: var(--danger);
  font-weight: 500;
}

/* ── Actions ── */

.ps-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: .75rem;
  border-top: 1px solid var(--gray-100);
  margin-top: auto;
}

@media (max-width: 600px) {
  .ps-grid-2 {
    grid-template-columns: 1fr;
  }

  .ps-tab-content {
    padding: 1.25rem;
  }

  .ps-identity-card {
    padding: 1.5rem 1rem;
  }
}

/* ── Dashboard (db-) ─────────────────────────────────────────────────────────
   Matches HRM v1 Dashboard.css design — stat cards with coloured left border,
   2-column chart grid, subscription/payment lists, workload bars.           */

.db-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.db-greeting {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 4px;
}

.db-subtitle {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin: 0;
}

.db-grid-4 {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.db-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .db-grid-2 {
    grid-template-columns: 1fr;
  }
}

.db-stat-card {
  flex: 1 1 180px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px 18px;
  border-left: 4px solid transparent;
}

.db-stat-primary {
  border-left-color: #6366f1;
}

.db-stat-primary .db-stat-icon {
  background: rgba(99, 102, 241, .1);
  color: #6366f1;
}

.db-stat-success {
  border-left-color: #10b981;
}

.db-stat-success .db-stat-icon {
  background: rgba(16, 185, 129, .1);
  color: #10b981;
}

.db-stat-warning {
  border-left-color: #f59e0b;
}

.db-stat-warning .db-stat-icon {
  background: rgba(245, 158, 11, .1);
  color: #f59e0b;
}

.db-stat-info {
  border-left-color: #3b82f6;
}

.db-stat-info .db-stat-icon {
  background: rgba(59, 130, 246, .1);
  color: #3b82f6;
}

.db-stat-danger {
  border-left-color: #ef4444;
}

.db-stat-danger .db-stat-icon {
  background: rgba(239, 68, 68, .1);
  color: #ef4444;
}

.db-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.db-stat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.db-stat-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.db-stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.db-stat-sub {
  font-size: var(--text-xs);
  color: var(--gray-400);
}

.db-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 0;
}

.db-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.db-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gray-800);
  margin: 0 0 16px;
}

.db-card-subtitle {
  font-size: var(--text-xs);
  color: var(--gray-400);
}

.db-empty {
  color: var(--gray-400);
  font-size: var(--text-sm);
  text-align: center;
  padding: 20px 0;
}

.db-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.db-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-50);
}

.db-list-row:last-child {
  border-bottom: none;
}

.db-list-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.db-list-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.db-list-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-800);
}

.db-list-sub {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

.db-list-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.db-list-amount {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-800);
}

.db-workload-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-workload-bar {
  width: 80px;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}

.db-workload-fill {
  height: 100%;
  border-radius: 4px;
}

.db-workload-pct {
  font-size: var(--text-xs);
  color: var(--gray-500);
  width: 28px;
}

.db-quick-actions-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.db-qa-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--gray-200);
  background: #fff;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-700);
  transition: border-color .15s, color .15s, background .15s, transform .1s;
  min-height: 44px;
}

.db-qa-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, .04);
  transform: translateY(-1px);
}

.db-qa-small {
  padding: 7px 12px;
  font-size: var(--text-xs);
}

/* ── All Work page (aw-) ─────────────────────────────────────────────────────
   Ported from HRM v1 AllWork.css — unified projects + subscriptions list    */

.aw-page {
  padding: 28px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.aw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.aw-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  color: var(--gray-500);
  margin-bottom: 6px;
  letter-spacing: .03em;
  text-transform: uppercase;
  font-weight: 500;
}

.aw-breadcrumb svg {
  color: var(--primary);
}

.aw-breadcrumb-sep {
  color: var(--gray-300);
}

.aw-breadcrumb-active {
  color: var(--gray-700);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.aw-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 4px;
  letter-spacing: -.02em;
}

.aw-subtitle {
  font-size: .85rem;
  color: var(--gray-500);
  margin: 0;
}

.aw-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  min-height: 44px;
  font-family: inherit;
}

.aw-btn-primary:hover {
  background: #4f46e5;
}

.aw-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  color: #be123c;
  font-size: .85rem;
  margin-bottom: 20px;
}

.aw-alert span {
  flex: 1;
}

.aw-alert button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 2px;
  display: flex;
  align-items: center;
}

.aw-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.aw-stat {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
  transition: box-shadow .15s;
}

.aw-stat:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.aw-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -.03em;
}

.aw-stat-value.aw-stat-blue {
  color: #6366f1;
}

.aw-stat-value.aw-stat-purple {
  color: #7c3aed;
}

.aw-stat-value.aw-stat-red {
  color: #dc2626;
}

.aw-stat-label {
  font-size: .78rem;
  color: var(--gray-500);
  font-weight: 500;
}

.aw-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.aw-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.aw-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

.aw-search {
  width: 100%;
  padding: 9px 36px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  font-size: .85rem;
  background: #fff;
  color: var(--gray-900);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
  min-height: 40px;
  box-sizing: border-box;
}

.aw-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.aw-search::placeholder {
  color: var(--gray-400);
}

.aw-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  padding: 2px;
}

.aw-search-clear:hover {
  color: var(--gray-700);
}

.aw-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.aw-chips {
  display: flex;
  gap: 6px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 4px;
}

.aw-chip {
  padding: 6px 14px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
  font-family: inherit;
  white-space: nowrap;
}

.aw-chip:hover {
  background: var(--gray-100);
}

.aw-chip.aw-chip-active {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

.aw-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.aw-select {
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: #fff;
  font-size: .82rem;
  color: var(--gray-700);
  cursor: pointer;
  outline: none;
  appearance: none;
  font-family: inherit;
  min-height: 38px;
  transition: border-color .15s;
}

.aw-select:focus {
  border-color: var(--primary);
}

.aw-select-icon {
  position: absolute;
  right: 10px;
  pointer-events: none;
  color: var(--gray-400);
}

.aw-table-wrap {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
  overflow-x: auto;
}

.aw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.aw-thead th {
  padding: 13px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}

.aw-tr {
  border-bottom: 1px solid var(--gray-50);
  cursor: pointer;
  transition: background .1s;
}

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

.aw-tr:hover {
  background: #fafafe;
}

.aw-td {
  padding: 14px 16px;
  color: var(--gray-800);
  vertical-align: middle;
}

.aw-td-name {
  min-width: 220px;
}

.aw-td-owner {
  min-width: 140px;
}

.aw-td-date {
  min-width: 130px;
}

.aw-td-billing {
  min-width: 120px;
}

.aw-td-client {
  min-width: 120px;
  font-size: .83rem;
}

.aw-td-action {
  width: 44px;
}

.aw-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aw-name-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .8125rem;
  font-weight: 700;
}

.aw-name-icon-blue {
  background: #ede9fe;
  color: #6366f1;
}

.aw-name-icon-purple {
  background: #fef3c7;
  color: #d97706;
}

.aw-name {
  font-weight: 600;
  color: var(--gray-900);
  font-size: .875rem;
  line-height: 1.3;
}

.aw-name-sub {
  font-size: .75rem;
  color: var(--gray-400);
  margin-top: 2px;
}

.aw-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
  white-space: nowrap;
}

.aw-badge-project {
  background: #eef2ff;
  color: #6366f1;
}

.aw-badge-recurring {
  background: #f3e8ff;
  color: #7c3aed;
}

.aw-badge-ongoing {
  background: #ecfdf5;
  color: #059669;
}

.aw-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
  text-transform: capitalize;
}

.aw-status-active {
  background: #dcfce7;
  color: #15803d;
}

.aw-status-completed {
  background: #e0e7ff;
  color: #4338ca;
}

.aw-status-hold {
  background: #fff7ed;
  color: #c2410c;
}

.aw-status-archived {
  background: var(--gray-100);
  color: var(--gray-500);
}

.aw-owner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .83rem;
  color: var(--gray-700);
}

.aw-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aw-date-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  color: var(--gray-600);
}

.aw-date-cell svg {
  color: var(--gray-400);
}

.aw-date-overdue {
  color: #dc2626;
}

.aw-date-overdue svg {
  color: #dc2626;
}

.aw-billing-cell {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .83rem;
  font-weight: 600;
  color: var(--gray-800);
}

.aw-billing-cycle {
  font-size: .72rem;
  font-weight: 500;
  color: var(--gray-400);
  margin-left: 1px;
}

.aw-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--gray-100);
  background: #fff;
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s, color .1s, border-color .1s;
}

.aw-action-btn:hover {
  background: #eef2ff;
  color: var(--primary);
  border-color: #c7d2fe;
}

.aw-muted {
  color: var(--gray-400);
  font-size: .82rem;
}

.aw-code {
  display: inline-block;
  padding: .2rem .5rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  font-size: .75rem;
  font-family: 'Courier New', monospace;
  color: #475569;
  letter-spacing: .04em;
  font-weight: 600;
}

.aw-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 24px;
  color: var(--gray-500);
  font-size: .9rem;
}

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

.aw-spin {
  animation: aw-spin 0.9s linear infinite;
}

.aw-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 72px 24px;
  text-align: center;
}

.aw-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  margin-bottom: 4px;
}

.aw-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

.aw-empty-sub {
  font-size: .85rem;
  color: var(--gray-500);
  margin: 0 0 8px;
}

.aw-footer {
  padding: 12px 4px;
  font-size: .78rem;
  color: var(--gray-400);
  text-align: right;
}

.aw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.aw-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
  padding: 28px;
  z-index: var(--z-modal);
}

.aw-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.aw-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.aw-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--gray-100);
  background: #fff;
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s;
}

.aw-modal-close:hover {
  background: var(--gray-50);
}

.aw-modal-sub {
  font-size: .85rem;
  color: var(--gray-500);
  margin: 0 0 24px;
}

.aw-modal-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aw-modal-option {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border: 2px solid var(--gray-100);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
  font-family: inherit;
  width: 100%;
}

.aw-modal-option:hover {
  border-color: var(--primary);
  background: #fafafe;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .1);
}

.aw-modal-option-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aw-modal-option-blue {
  background: #eef2ff;
  color: #6366f1;
}

.aw-modal-option-purple {
  background: #f3e8ff;
  color: #7c3aed;
}

.aw-modal-option-text {
  flex: 1;
}

.aw-modal-option-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.aw-modal-option-desc {
  font-size: .8rem;
  color: var(--gray-500);
  line-height: 1.5;
}

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

@media (max-width: 768px) {
  .aw-page {
    padding: 16px;
  }

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

  .aw-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .aw-search-wrap {
    max-width: none;
  }

  .aw-td-owner,
  .aw-td-billing,
  .aw-td-date {
    display: none;
  }
}

/* ── Spaces / All Work (tasks-page split layout) ─────────────────────────────
   Ported from HRM v1 TaskManagement.css                                     */

.tasks-page {
  display: flex;
  height: calc(100vh - var(--navbar-height));
  overflow: hidden;
}

@media (max-width: 768px) {
  .tasks-page {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
}

/* Left panel */
.spaces-panel {
  width: 230px;
  min-width: 230px;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .spaces-panel {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    max-height: 280px;
  }
}

.spaces-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 10px;
  flex-shrink: 0;
}

.spaces-panel-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #718096;
}

.spaces-panel-add {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #718096;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  padding: 0;
}

.spaces-panel-add:hover {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

.spaces-panel-search {
  position: relative;
  padding: 0 10px 8px;
  flex-shrink: 0;
}

.spaces-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-60%);
  color: #a0aec0;
  pointer-events: none;
}

.spaces-search-input {
  width: 100%;
  padding: 5px 8px 5px 26px;
  font-size: .8rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #2d3748;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}

.spaces-search-input:focus {
  border-color: #667eea;
}

.spaces-search-input::placeholder {
  color: #c5cbd8;
}

.spaces-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
}

.spaces-nav::-webkit-scrollbar {
  width: 4px;
}

.spaces-nav::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 2px;
}

.spaces-nav-loading,
.spaces-nav-empty {
  font-size: .78rem;
  color: #a0aec0;
  text-align: center;
  padding: 20px 10px;
}

.spaces-client-group {
  margin-bottom: 2px;
}

.spaces-client-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 8px 5px 10px;
  border-radius: 6px;
  text-align: left;
  color: #374151;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: background .12s;
}

.spaces-client-header:hover {
  background: #f1f5f9;
}

.spaces-client-chevron {
  font-size: .75rem;
  color: #94a3b8;
  transition: transform .15s;
  display: inline-block;
}

.spaces-client-chevron.collapsed {
  transform: rotate(-90deg);
}

.spaces-client-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spaces-client-count {
  font-size: .65rem;
  background: #e2e8f0;
  color: #64748b;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

.spaces-client-items {
  padding-left: 8px;
}

.spaces-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}

.spaces-nav-item:hover {
  background: #edf2f7;
}

.spaces-nav-item:hover .spaces-nav-edit {
  opacity: 1;
}

.spaces-nav-item-active {
  background: rgba(99, 102, 241, 0.09) !important;
}

.spaces-nav-item-active .spaces-nav-name {
  color: #4f46e5 !important;
}

.spaces-nav-item-active .spaces-nav-code {
  color: #6366f1 !important;
}

.spaces-nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spaces-nav-icon-project {
  background: #dbeafe;
  color: #2563eb;
}

.spaces-nav-icon-sub {
  background: #ede9fe;
  color: #7c3aed;
}

.spaces-nav-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.spaces-nav-name {
  font-size: .78rem;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.spaces-nav-code {
  font-size: .68rem;
  font-weight: 500;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spaces-nav-item-active .spaces-nav-name {
  color: #fff;
}

.spaces-nav-item-active .spaces-nav-code {
  color: rgba(255, 255, 255, .75);
}

.spaces-nav-edit {
  opacity: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  color: #a0aec0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity .12s;
}

.spaces-nav-edit:hover {
  background: rgba(0, 0, 0, .08);
}

/* Right panel */
.spaces-board-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

@media (max-width: 768px) {
  .spaces-board-area {
    overflow: visible;
  }
}

.spaces-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
  color: #a0aec0;
  text-align: center;
  padding: 40px;
}

.spaces-welcome-icon {
  color: #cbd5e0;
}

.spaces-welcome h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #4a5568;
}

.spaces-welcome p {
  margin: 0;
  font-size: .875rem;
}

.space-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  
  flex-shrink: 0;
}

.space-board-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.space-board-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.space-board-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.space-board-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a202c;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.space-board-client {
  display: block;
  font-size: .75rem;
  color: #718096;
  margin-top: 1px;
}

.spaces-board-scroll {
  flex: 1;
  overflow: auto;
  padding: 0 20px 16px;
}

/* Toolbar */
.task-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #fff;
    border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.task-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  align-items: center;
}

.filter-search {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: .875rem;
  background: #f8fafc;
  color: #2d3748;
  min-width: 160px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

.filter-search:focus {
  border-color: #667eea;
}

.filter-search::placeholder {
  color: #a0aec0;
}

.filter-select {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: .82rem;
  background: #f8fafc;
  color: #4a5568;
  cursor: pointer;
  min-width: 140px;
  font-family: inherit;
  outline: none;
}

.filter-select:focus {
  border-color: #667eea;
}

.view-toggle {
  display: flex;
  gap: 2px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 7px;
}

.view-btn {
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: #718096;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 5px;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
}

.view-btn:hover {
  background: #e2e8f0;
  color: #2d3748;
}

.view-btn.active {
  background: #fff;
  color: #667eea;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  font-weight: 600;
}

/* Add Work modal */
.add-work-modal {
  padding: 28px;
}

.add-work-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.add-work-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a202c;
}

.add-work-sub {
  margin: 0;
  font-size: .82rem;
  color: #718096;
}

.add-work-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.add-work-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.add-work-option:hover {
  border-color: #667eea;
  box-shadow: 0 2px 12px rgba(102, 126, 234, .12);
}

.add-work-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.add-work-icon-project {
  background: #ebf4ff;
  color: #3182ce;
}

.add-work-icon-recurring {
  background: #f3eeff;
  color: #805ad5;
}

.add-work-option-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.add-work-option-title {
  font-size: .95rem;
  font-weight: 600;
  color: #1a202c;
}

.add-work-option-desc {
  font-size: .8rem;
  color: #718096;
  line-height: 1.45;
}

/* ── Project Management (pr- / of-) ──────────────────────────────────────────
   Ported from HRM v1 ProjectManagement.css                                  */

.pr-page {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.pr-detail-page {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.pr-loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.pr-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: pr-spin .75s linear infinite;
}

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

.pr-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.pr-header-left {
  flex: 1;
}

.pr-breadcrumb {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .875rem;
  margin-bottom: .5rem;
}

.pr-breadcrumb-parent {
  color: #64748b;
}

.pr-breadcrumb-sep {
  color: #94a3b8;
}

.pr-breadcrumb-active {
  color: #6366f1;
  font-weight: 500;
}

.pr-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 .25rem;
  letter-spacing: -.03em;
  line-height: 1.15;
}

.pr-subtitle {
  font-size: .875rem;
  color: #64748b;
  margin: 0;
}

.pr-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pr-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.pr-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: .625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pr-stat-icon--blue {
  background: #eff6ff;
  color: #2563eb;
}

.pr-stat-icon--green {
  background: #f0fdf4;
  color: #16a34a;
}

.pr-stat-icon--yellow {
  background: #fefce8;
  color: #ca8a04;
}

.pr-stat-icon--indigo {
  background: #ede9fe;
  color: #6366f1;
}

.pr-stat-label {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: .25rem;
}

.pr-stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

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

@media (max-width: 768px) {

  .pr-page,
  .pr-detail-page {
    padding: 1rem;
  }

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

  .pr-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.pr-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  overflow: hidden;
}

.pr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  gap: 1rem;
  flex-wrap: wrap;
}

.pr-filters {
  display: flex;
  gap: .25rem;
}

.pr-filter-btn {
  padding: .5rem 1rem;
  border: none;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  border-radius: .5rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.pr-filter-btn:hover {
  background: #f8fafc;
  color: #334155;
}

.pr-filter-btn--active {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
}

.pr-toolbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.pr-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pr-search-icon {
  position: absolute;
  left: .75rem;
  color: #94a3b8;
  pointer-events: none;
}

.pr-search-input {
  padding: .5rem .75rem .5rem 2.25rem;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  font-family: inherit;
  font-size: .875rem;
  color: #334155;
  outline: none;
  width: 220px;
  background: #f8fafc;
  transition: border-color .15s;
}

.pr-search-input:focus {
  border-color: #6366f1;
  background: #fff;
}

.pr-table-wrap {
  overflow-x: auto;
}

.pr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.pr-table thead th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: #94a3b8;
  text-transform: uppercase;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.pr-table tbody tr {
  border-bottom: 1px solid #f8fafc;
  transition: background .1s;
}

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

.pr-clickable-row {
  cursor: pointer;
}

.pr-clickable-row:hover {
  background: #fafbff;
}

.pr-table td {
  padding: .875rem 1rem;
  color: #334155;
  vertical-align: middle;
}

.pr-client-cell {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.pr-avatar {
  width: 36px;
  height: 36px;
  border-radius: .5rem;
  background: #ede9fe;
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.pr-client-name {
  font-weight: 600;
  color: #0f172a;
}

.pr-client-sub {
  font-size: .75rem;
  color: #94a3b8;
  margin-top: 2px;
}

.pr-code {
  display: inline-block;
  padding: .2rem .5rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  font-size: .75rem;
  font-family: 'Courier New', monospace;
  color: #475569;
  letter-spacing: .04em;
  font-weight: 600;
}

.pr-dash {
  color: #cbd5e1;
}

.pr-manager {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .83rem;
  color: #374151;
}

.pr-manager-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pr-billing-amount {
  font-size: .83rem;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
}

.pr-row-actions {
  display: flex;
  gap: .375rem;
  align-items: center;
}

.pr-status {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .25rem .625rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

.pr-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pr-status--active {
  background: #f0fdf4;
  color: #16a34a;
}

.pr-status--inactive {
  background: #fef2f2;
  color: #dc2626;
}

.pr-status--paused {
  background: #fff7ed;
  color: #c2410c;
}

.pr-status--closed {
  background: #f1f5f9;
  color: #64748b;
}

.pr-status--completed {
  background: #ede9fe;
  color: #6366f1;
}

.pr-status-chip {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: .375rem;
  font-size: .75rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}

.pr-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.5rem;
  border-top: 1px solid #f1f5f9;
}

.pr-count {
  font-size: .8rem;
  color: #64748b;
}

.pr-pagination {
  display: flex;
  gap: .375rem;
  align-items: center;
}

/* Detail view */
.pr-detail-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

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

.pr-detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: .875rem;
  background: #ede9fe;
  color: #7c3aed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  font-weight: 800;
  flex-shrink: 0;
}

.pr-detail-name-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .375rem;
}

.pr-detail-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.pr-detail-status-badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .625rem;
  border-radius: .375rem;
  font-size: .75rem;
  font-weight: 600;
}

.pr-detail-status-badge--active {
  background: #dcfce7;
  color: #15803d;
}

.pr-detail-status-badge--on-hold {
  background: #fff7ed;
  color: #c2410c;
}

.pr-detail-status-badge--completed {
  background: #ede9fe;
  color: #6366f1;
}

.pr-detail-status-badge--archived {
  background: #f1f5f9;
  color: #64748b;
}

.pr-detail-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.pr-detail-code-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .5rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  font-size: .75rem;
  font-family: 'Courier New', monospace;
  color: #475569;
  font-weight: 600;
}

.pr-detail-meta-item {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .8rem;
  color: #64748b;
}

.pr-detail-header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.pr-more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  font-size: .875rem;
  color: var(--gray-700);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.pr-more-item:hover { background: var(--gray-50); }
.pr-more-danger { color: var(--danger, #ef4444); }

.pr-detail-content-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  overflow: hidden;
}

.pr-detail-tabs-nav {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  padding: 0 1.5rem;
}

.pr-detail-tab {
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}

.pr-detail-tab:hover {
  color: #334155;
}

.pr-detail-tab--active {
  color: #6366f1;
  border-bottom-color: #6366f1;
  font-weight: 600;
}

.pr-detail-tab-body {
  padding: 1.5rem;
}

.pr-detail-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.pr-detail-label {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: .375rem;
}

.pr-detail-value {
  display: flex;
  align-items: center;
  gap: .375rem;
  font-size: .875rem;
  font-weight: 600;
  color: #334155;
}

.pr-detail-empty {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

.pr-detail-desc-section {
  border-top: 1px solid #f1f5f9;
  padding-top: 1.25rem;
}

.pr-detail-desc-box {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: .625rem;
  padding: 1rem 1.25rem;
  margin-top: .5rem;
  min-height: 60px;
}

.pr-detail-desc-text {
  font-size: .875rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

.pr-detail-desc-empty {
  font-size: .875rem;
  color: #94a3b8;
  margin: 0;
}

.pr-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.pr-tab-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin: 0;
}

.pr-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 3rem;
  color: #94a3b8;
  text-align: center;
}

.pr-empty-state p {
  margin: 0;
  font-size: .875rem;
}

/* Milestones */
.pr-ms-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.pr-ms-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .625rem;
}

.pr-ms-item--done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.pr-ms-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pr-ms-item--done .pr-ms-icon {
  background: #dcfce7;
  color: #16a34a;
}

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

.pr-ms-title {
  font-size: .875rem;
  font-weight: 600;
  color: #334155;
}

.pr-ms-desc {
  font-size: .8rem;
  color: #64748b;
  margin-top: .25rem;
}

.pr-ms-date {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .75rem;
  color: #94a3b8;
  margin-top: .375rem;
}

.pr-ms-status {
  font-size: .72rem;
  font-weight: 600;
  padding: .25rem .625rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.pr-ms-status--completed {
  background: #dcfce7;
  color: #15803d;
}

.pr-ms-status--pending {
  background: #fef3c7;
  color: #92650a;
}

.pr-ms-actions {
  display: flex;
  gap: .25rem;
}

.pr-ms-edit-btn,
.pr-ms-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s;
}

.pr-ms-edit-btn:hover {
  background: #ede9fe;
  color: #6366f1;
}

.pr-ms-delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Team table */
.pr-team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.pr-team-table thead th {
  padding: .625rem 1rem;
  text-align: left;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: #94a3b8;
  text-transform: uppercase;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.pr-team-table tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #f8fafc;
}

.pr-team-cell {
  display: flex;
  align-items: center;
  gap: .625rem;
}

.pr-team-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.pr-team-name {
  font-weight: 500;
  color: #334155;
  font-size: .875rem;
}

/* Files */
.pr-files-list {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.pr-file-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .875rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .625rem;
}

.pr-file-icon {
  color: #94a3b8;
  flex-shrink: 0;
}

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

.pr-file-name {
  font-size: .875rem;
  font-weight: 500;
  color: #334155;
}

.pr-file-meta {
  font-size: .75rem;
  color: #94a3b8;
  margin-top: 2px;
}

.pr-file-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-shrink: 0;
}

.pr-download-btn {
  padding: .375rem .875rem;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: .375rem;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.pr-download-btn:hover {
  background: #4f46e5;
}

/* Billing */

.pr-billing-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pr-billing-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  padding: 1rem 1.25rem;
}

.pr-billing-stat-label {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: .35rem;
}

.pr-billing-stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.pr-billing-stat-value--paid {
  color: #16a34a;
}

.pr-billing-stat-value--invoiced {
  color: #2563eb;
}

.pr-billing-stat-value--pending {
  color: #d97706;
}

.pr-billing-stat-value--remaining {
  color: #6366f1;
}

.pr-billing-stat-value--over {
  color: #dc2626;
}

.pr-billing-progress-section {
  margin-bottom: 1.5rem;
}

.pr-billing-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: #64748b;
  margin-bottom: .4rem;
}

.pr-billing-progress-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
}

.pr-billing-progress-paid {
  background: #16a34a;
  height: 100%;
  transition: width .3s;
}

.pr-billing-progress-invoiced {
  background: #93c5fd;
  height: 100%;
  transition: width .3s;
}

.pr-co-section {
  margin-top: 1.5rem;
}

.pr-co-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .875rem;
}

.pr-co-title {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0 0 .125rem;
}

.pr-co-empty {
  font-size: .8125rem;
  color: var(--gray-400);
  padding: .75rem 0;
  margin: 0;
}

.pr-inv-type {
  display: inline-block;
  padding: .15rem .4rem;
  border-radius: .25rem;
  font-size: .72rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}

/* ── Subscriptions (sub-) ────────────────────────────────────────────────────
   Ported from HRM v1 SubscriptionManagement.css                             */

.sub-page {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.sub-loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.sub-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: sub-spin .75s linear infinite;
}

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

.sub-alert {
  padding: .875rem 1.25rem;
  border-radius: .75rem;
  font-size: .875rem;
  margin-bottom: 1.5rem;
}

.sub-alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.sub-alert--success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.sub-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.sub-header-left {
  flex: 1;
}

.sub-breadcrumb {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .875rem;
  margin-bottom: .5rem;
}

.sub-breadcrumb-parent {
  color: #64748b;
}

.sub-breadcrumb-sep {
  color: #94a3b8;
}

.sub-breadcrumb-active {
  color: #6366f1;
  font-weight: 500;
}

.sub-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 .25rem;
  letter-spacing: -.03em;
  line-height: 1.15;
}

.sub-subtitle {
  font-size: .875rem;
  color: #64748b;
  margin: 0;
}

.sub-add-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: .75rem;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, .25);
  transition: background .15s, transform .15s;
  -webkit-appearance: none;
  appearance: none;
}

.sub-add-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.sub-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sub-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.sub-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: .625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sub-stat-icon--blue {
  background: #eff6ff;
  color: #2563eb;
}

.sub-stat-icon--green {
  background: #f0fdf4;
  color: #16a34a;
}

.sub-stat-icon--yellow {
  background: #fefce8;
  color: #ca8a04;
}

.sub-stat-icon--red {
  background: #fff1f2;
  color: #e11d48;
}

.sub-stat-label {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: .25rem;
}

.sub-stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

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

@media (max-width: 768px) {
  .sub-page {
    padding: 1rem;
  }

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

  .sub-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.sub-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  overflow: hidden;
}

.sub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  gap: 1rem;
  flex-wrap: wrap;
}

.sub-filters {
  display: flex;
  gap: .25rem;
}

.sub-filter-btn {
  padding: .5rem 1rem;
  border: none;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  border-radius: .5rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.sub-filter-btn:hover {
  background: #f8fafc;
  color: #334155;
}

.sub-filter-btn--active {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
}

.sub-toolbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sub-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sub-search-icon {
  position: absolute;
  left: .75rem;
  color: #94a3b8;
  pointer-events: none;
}

.sub-search-input {
  padding: .5rem .75rem .5rem 2.25rem;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  font-family: inherit;
  font-size: .875rem;
  color: #334155;
  outline: none;
  width: 220px;
  background: #f8fafc;
  transition: border-color .15s;
}

.sub-search-input:focus {
  border-color: #6366f1;
  background: #fff;
}

.sub-table-wrap {
  overflow-x: auto;
}

.sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.sub-table thead th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: #94a3b8;
  text-transform: uppercase;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.sub-table tbody tr {
  border-bottom: 1px solid #f8fafc;
  transition: background .1s;
}

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

.sub-table td {
  padding: .875rem 1rem;
  color: #334155;
  vertical-align: middle;
}

.sub-clickable-row {
  cursor: pointer;
}

.sub-clickable-row:hover {
  background: #f8fafc;
}

.sub-client-cell {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sub-avatar {
  width: 36px;
  height: 36px;
  border-radius: .5rem;
  background: #fef3c7;
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sub-client-name {
  font-weight: 600;
  color: #0f172a;
}

.sub-client-sub {
  font-size: .75rem;
  color: #94a3b8;
  margin-top: 2px;
}

.sub-code {
  display: inline-block;
  padding: .2rem .5rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  font-size: .75rem;
  font-family: 'Courier New', monospace;
  color: #475569;
  letter-spacing: .04em;
  font-weight: 600;
}

.sub-dash {
  color: #cbd5e1;
}

.sub-manager {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .83rem;
  color: #374151;
}

.sub-manager-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sub-billing-cycle {
  font-size: .72rem;
  font-weight: 500;
  color: #9ca3af;
  margin-left: 1px;
}

.sub-status {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .25rem .625rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

.sub-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sub-status--active {
  background: #f0fdf4;
  color: #16a34a;
}

.sub-status--paused {
  background: #fefce8;
  color: #ca8a04;
}

.sub-status--cancelled {
  background: #fef2f2;
  color: #dc2626;
}

.sub-row-actions {
  display: flex;
  gap: .375rem;
  align-items: center;
}

.sub-edit-btn,
.sub-delete-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  background: #fff;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.sub-edit-btn {
  color: #475569;
}

.sub-edit-btn:hover {
  background: #f1f5f9;
  color: #6366f1;
}

.sub-delete-btn {
  color: #94a3b8;
}

.sub-delete-btn:hover {
  background: #fff1f2;
  border-color: #fecaca;
  color: #e11d48;
}

.sub-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 1rem;
}

.sub-count {
  font-size: .875rem;
  color: #64748b;
}

.sub-count strong {
  color: #0f172a;
}

.sub-pagination {
  display: flex;
  gap: .25rem;
}

.sub-page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 .75rem;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  background: #fff;
  font-family: inherit;
  font-size: .8125rem;
  color: #475569;
  cursor: pointer;
  transition: all .15s;
}

.sub-page-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #6366f1;
  color: #6366f1;
}

.sub-page-btn--active {
  background: #6366f1 !important;
  color: #fff !important;
  border-color: #6366f1 !important;
  font-weight: 700;
}

.sub-page-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* of- additions for subscriptions form */
.of-back-link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.5rem;
  transition: color .15s;
  -webkit-appearance: none;
  appearance: none;
}

.of-back-link:hover {
  color: #6366f1;
}

.of-cancel-btn {
  padding: .625rem 1.25rem;
  border: 1.5px solid #e2e8f0;
  border-radius: .5rem;
  background: #fff;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background .15s;
  -webkit-appearance: none;
  appearance: none;
}

.of-cancel-btn:hover {
  background: #f8fafc;
}

.of-save-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .625rem 1.5rem;
  background: #6366f1;
  border: none;
  border-radius: .5rem;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, .3);
  transition: background .15s, transform .15s;
  -webkit-appearance: none;
  appearance: none;
}

.of-save-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.of-save-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* Form (of-) */
.of-page {
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .of-page {
    padding: 1rem;
  }
}

.of-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
}

.of-card-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #f1f5f9;
}

.of-card-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.of-card-icon {
  width: 44px;
  height: 44px;
  background: #ede9fe;
  color: #7c3aed;
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.of-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 .125rem;
}

.of-card-subtitle {
  font-size: .8125rem;
  color: #64748b;
  margin: 0;
}

.of-tabs-nav {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 2rem;
  overflow-x: auto;
  background: #fff;
}

.of-tab {
  padding: 1rem 1.5rem;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.of-tab:hover {
  color: #334155;
  border-bottom-color: #cbd5e1;
}

.of-tab--active {
  color: #6366f1;
  border-bottom-color: #6366f1;
  font-weight: 600;
}

.of-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: inherit;
  font-size: .875rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.of-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
  cursor: pointer;
}

.of-form-body {
  padding: 2rem;
}

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

.of-field {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.of-span-2 {
  grid-column: span 2;
}

.of-label {
  font-size: .625rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.of-required {
  color: #ef4444;
}

.of-input {
  height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  background: #f8fafc;
  font-family: inherit;
  font-size: .875rem;
  color: #0f172a;
  width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.of-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
  background: #fff;
}

.of-input::placeholder {
  color: #c4cad4;
}

textarea.of-input {
  height: auto;
  padding: .75rem 1rem;
  resize: vertical;
}

select.of-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2rem;
}

.of-code-group {
  display: flex;
  align-items: stretch;
}

.of-code-input {
  border-radius: .5rem 0 0 .5rem !important;
  border-right: none !important;
  flex: 1;
}

.of-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: 0 .875rem;
  height: 2.75rem;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 0 .5rem .5rem 0;
  color: #6d28d9;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
  transition: background .15s;
}

.of-generate-btn:hover {
  background: #6d28d9;
  color: #fff;
  border-color: #6d28d9;
}

.of-hint {
  font-size: .73rem;
  color: #94a3b8;
}

.of-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-top: 1px solid #e2e8f0;
  background: #fafafa;
}

.of-actions-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

@media (max-width: 768px) {
  .of-form-body {
    padding: 1.25rem;
  }

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

  .of-span-2 {
    grid-column: span 1;
  }

  .of-card-header {
    padding: 1.25rem;
  }
}

/* ── Subscription Detail (sub-detail-) ──────────────────────────────────────── */

.sub-detail-page {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .sub-detail-page {
    padding: 1rem;
  }
}

.sub-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.sub-back-link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}

.sub-back-link:hover {
  color: #6366f1;
}

.sub-edit-btn-detail {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: .5rem;
  background: #fff;
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all .15s;
}

.sub-edit-btn-detail:hover {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

.sub-detail-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.sub-detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: .875rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sub-detail-hero-info {
  flex: 1;
  min-width: 0;
}

.sub-detail-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 .25rem;
}

.sub-detail-client {
  font-size: .875rem;
  color: #64748b;
  margin: 0;
}

.sub-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .sub-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .sub-detail-grid {
    grid-template-columns: 1fr;
  }
}

.sub-detail-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.sub-detail-card-label {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: .5rem;
}

.sub-detail-card-val {
  font-size: .9375rem;
  font-weight: 600;
  color: #1e293b;
}

.sub-detail-card-val--big {
  font-size: 1.375rem;
  font-weight: 800;
  color: #0f172a;
}

.sub-detail-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.sub-detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.sub-detail-section-title {
  font-size: .9375rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.sub-detail-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: .7rem;
  font-weight: 700;
  padding: 0 .4rem;
}

.sub-detail-desc {
  font-size: .875rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

.sub-view-tasks-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .4375rem .875rem;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: .5rem;
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.sub-view-tasks-btn:hover {
  background: #4f46e5;
}

.sub-detail-progress-wrap {
  margin-bottom: 1.25rem;
}

.sub-detail-progress-bar {
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.sub-detail-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 999px;
  transition: width .4s ease;
}

.sub-detail-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
  margin-bottom: 1.25rem;
}

.sub-detail-status-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4375rem .875rem;
  background: var(--chip-bg, #f1f5f9);
  border-radius: .5rem;
  border: 1px solid;
  border-color: color-mix(in srgb, var(--chip-color, #64748b) 20%, transparent);
}

.sub-detail-status-chip-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--chip-color, #64748b);
  line-height: 1;
}

.sub-detail-status-chip-lbl {
  font-size: .75rem;
  font-weight: 500;
  color: var(--chip-color, #64748b);
}

.sub-detail-task-list {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.sub-detail-task-row {
  display: grid;
  grid-template-columns: 10px 70px 1fr 70px 120px;
  align-items: center;
  gap: .75rem;
  padding: .625rem .75rem;
  border-radius: .5rem;
  transition: background .1s;
}

.sub-detail-task-row:hover {
  background: #f8fafc;
}

.sub-detail-task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sub-detail-task-key {
  font-size: .7rem;
  font-weight: 700;
  color: #94a3b8;
  font-family: monospace;
  white-space: nowrap;
}

.sub-detail-task-title {
  font-size: .8125rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-detail-task-pri {
  font-size: .7rem;
  font-weight: 600;
  text-transform: capitalize;
  text-align: right;
}

.sub-detail-task-assignee {
  font-size: .75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

@media (max-width: 600px) {
  .sub-detail-task-row {
    grid-template-columns: 10px 1fr 60px;
  }

  .sub-detail-task-key,
  .sub-detail-task-pri,
  .sub-detail-task-assignee {
    display: none;
  }
}

.sub-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  gap: .875rem;
  color: #94a3b8;
  text-align: center;
}

.sub-detail-empty-icon {
  opacity: .4;
}

.sub-detail-empty-text {
  font-size: .875rem;
  font-weight: 500;
}

.sub-link-btn {
  background: none;
  border: none;
  color: #6366f1;
  font-family: inherit;
  font-size: .78rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.sub-link-btn:hover {
  color: #4f46e5;
}

/* ── Service Workspace (sw-) — tabbed detail view ────────────────────────────*/

.sw-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.sw-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 2rem 3rem;
}

@media (max-width: 768px) {
  .sw-page {
    padding: 1rem 1rem 2rem;
  }
}

/* Topbar */
.sw-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: .75rem;
  flex-wrap: wrap;
}

.sw-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  padding: .375rem .25rem;
  border-radius: .375rem;
  transition: color .15s;
}

.sw-back:hover {
  color: #0f172a;
}

.sw-back svg {
  flex-shrink: 0;
}

.sw-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .625rem;
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.sw-edit-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Hero */
.sw-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  margin-bottom: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

@media (max-width: 600px) {
  .sw-hero {
    flex-wrap: wrap;
  }
}

.sw-hero-avatar {
  width: 60px;
  height: 60px;
  border-radius: 1rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 1.625rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.sw-hero-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .375rem;
}

.sw-hero-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.sw-hero-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8375rem;
  color: #64748b;
  flex-wrap: wrap;
}

.sw-dot {
  color: #cbd5e1;
}

.sw-code {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: #f0f0ff;
  color: #6366f1;
  padding: .2rem .55rem;
  border-radius: .375rem;
  border: 1px solid #e0e0ff;
}

.sw-billing {
  font-size: .875rem;
  font-weight: 700;
  color: #1e293b;
}

/* Tab bar */
.sw-tabs {
  display: flex;
  align-items: center;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  border-radius: 0 0 0 0;
}

.sw-tabs::-webkit-scrollbar {
  display: none;
}

.sw-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .875rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}

.sw-tab:hover {
  color: #334155;
}

.sw-tab--active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

.sw-tab svg {
  opacity: .7;
}

.sw-tab--active svg {
  opacity: 1;
}

/* Tab body container */
.sw-tab-body {
  padding: .25rem 0;
}

/* Shared section header */
.sw-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.sw-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: .5rem;
  flex-wrap: wrap;
}

.sw-section-title {
  font-size: .9rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.sw-action-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background .15s;
}

.sw-action-btn:hover {
  background: #f1f5f9;
}

/* Empty states */
.sw-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: .875rem;
  color: #94a3b8;
  text-align: center;
}

.sw-empty svg {
  opacity: .35;
  width: 40px;
  height: 40px;
}

.sw-empty p {
  margin: 0;
  font-size: .875rem;
}

.sw-empty-sm {
  font-size: .8125rem;
  color: #94a3b8;
  padding: .75rem 0;
}

/* ── Overview tab ── */
.sw-overview {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sw-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .sw-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .sw-info-grid {
    grid-template-columns: 1fr;
  }
}

.sw-info-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.sw-info-label {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: .5rem;
}

.sw-info-val {
  font-size: .9375rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.sw-info-val--big {
  font-size: 1.375rem;
  font-weight: 800;
  color: #0f172a;
}

.sw-mini-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sw-desc {
  margin: 0;
  font-size: .875rem;
  color: #475569;
  line-height: 1.65;
}

.sw-progress-wrap {
  margin-bottom: 1rem;
}

.sw-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .4rem;
}

.sw-progress-label {
  font-size: .78rem;
  font-weight: 600;
  color: #475569;
}

.sw-progress-pct {
  font-size: .78rem;
  font-weight: 700;
  color: #6366f1;
}

.sw-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.sw-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #6366f1);
  border-radius: 999px;
  transition: width .5s ease;
}

.sw-status-chips {
  display: flex;
  gap: .625rem;
  flex-wrap: wrap;
}

.sw-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .625rem 1rem;
  background: var(--cb, #f1f5f9);
  border-radius: .625rem;
  min-width: 64px;
}

.sw-chip-n {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cc, #64748b);
  line-height: 1;
  margin-bottom: .2rem;
}

.sw-chip-l {
  font-size: .65rem;
  font-weight: 600;
  color: var(--cc, #64748b);
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .8;
}

/* ── Milestones tab ── */
.sw-ms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
}

.sw-ms-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  display: flex;
  flex-direction: column;
  gap: .625rem;
}

.sw-ms-card-hd {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.sw-ms-badge {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .2rem .5rem;
  border-radius: .375rem;
}

.sw-ms-title {
  font-size: .9rem;
  font-weight: 700;
  color: #1e293b;
}

.sw-ms-desc {
  font-size: .78rem;
  color: #64748b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sw-ms-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: .375rem;
  border-top: 1px solid #f1f5f9;
}

.sw-ms-meta {
  font-size: .72rem;
  color: #94a3b8;
}

.sw-ms-date {
  font-size: .72rem;
  color: #64748b;
  font-weight: 600;
}

/* ── Team tab ── */
.sw-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 1rem;
}

.sw-member-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
}

.sw-member-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .375rem;
}

.sw-member-name {
  font-size: .9rem;
  font-weight: 700;
  color: #1e293b;
}

.sw-member-role {
  font-size: .75rem;
  color: #6366f1;
  font-weight: 600;
}

.sw-member-email {
  font-size: .72rem;
  color: #94a3b8;
  word-break: break-all;
}

/* ── Files tab ── */
.sw-file-ext {
  display: inline-block;
  padding: .15rem .4rem;
  border-radius: .3rem;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.sw-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}

.sw-dl-btn:hover {
  background: #f1f5f9;
}

/* ── Tasks tab ── */
.sw-tasks-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.sw-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .75rem;
  overflow-x: auto;
}

@media (max-width: 1100px) {
  .sw-board {
    grid-template-columns: repeat(3, minmax(200px, 1fr));
  }
}

@media (max-width: 700px) {
  .sw-board {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

.sw-board-col {
  background: #f3f0ff;
  border-radius: .875rem;
  padding: .875rem;
  min-width: 180px;
}

.sw-board-col:nth-child(2) {
  background: #fff3e8;
}

.sw-board-col:nth-child(3) {
  background: #e8f8f0;
}

.sw-board-col:nth-child(4) {
  background: #fff0f4;
}

.sw-board-col:nth-child(5) {
  background: #e8f4ff;
}

.sw-board-col-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 3px solid;
  border-radius: 2px 2px 0 0;
  padding-top: .625rem;
  margin-bottom: .75rem;
}

.sw-board-col-label {
  font-size: .75rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.sw-board-col-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: .7rem;
  font-weight: 700;
  padding: 0 .35rem;
}

.sw-board-col-body {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.sw-board-empty {
  font-size: .75rem;
  color: #cbd5e1;
  text-align: center;
  padding: .75rem;
}

.sw-task-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .625rem;
  padding: .875rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.sw-task-key {
  font-size: .65rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: .05em;
  font-family: 'Courier New', monospace;
}

.sw-task-title {
  font-size: .8rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sw-task-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .125rem;
}

.sw-task-pri {
  font-size: .68rem;
  font-weight: 700;
  text-transform: capitalize;
}

.sw-task-assignee {
  font-size: .7rem;
  color: #64748b;
  background: #f1f5f9;
  padding: .15rem .45rem;
  border-radius: 999px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Billing tab ── */
.sw-bill-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .sw-bill-summary {
    grid-template-columns: 1fr;
  }
}

.sw-bill-sum-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.sw-inv-status {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: .375rem;
  font-size: .72rem;
  font-weight: 700;
}

/* ── Shared table ── */
.sw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8375rem;
}

.sw-table thead {
  background: #f8fafc;
}

.sw-table th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.sw-table td {
  padding: .875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: middle;
}

.sw-table tbody tr:hover {
  background: #fafbfc;
}

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

/* ── Service Workspace ends ── */

/* ── Resource Allocations (ra-) ──────────────────────────────────────────────
   Ported from HRM v1 AllocationsManagement.css                              */

.ra-page {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.ra-loading-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.ra-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: ra-spin .75s linear infinite;
}

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

.ra-alert {
  padding: .875rem 1.25rem;
  border-radius: .75rem;
  font-size: .875rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.ra-alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.ra-alert-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: .25rem;
  display: flex;
  align-items: center;
}

.ra-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.ra-header-left {
  flex: 1;
}

.ra-breadcrumb {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .875rem;
  margin-bottom: .5rem;
}

.ra-breadcrumb-parent {
  color: #64748b;
}

.ra-breadcrumb-sep {
  color: #94a3b8;
}

.ra-breadcrumb-active {
  color: #6366f1;
  font-weight: 500;
}

.ra-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 .25rem;
  letter-spacing: -.03em;
  line-height: 1.15;
}

.ra-subtitle {
  font-size: .875rem;
  color: #64748b;
  margin: 0;
}

.ra-add-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: .75rem;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, .25);
  transition: background .15s, transform .15s;
  -webkit-appearance: none;
  appearance: none;
}

.ra-add-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.ra-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ra-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.ra-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: .625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ra-stat-icon--blue {
  background: #eff6ff;
  color: #2563eb;
}

.ra-stat-icon--green {
  background: #f0fdf4;
  color: #16a34a;
}

.ra-stat-icon--yellow {
  background: #fefce8;
  color: #ca8a04;
}

.ra-stat-icon--indigo {
  background: #ede9fe;
  color: #6366f1;
}

.ra-stat-label {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: .25rem;
}

.ra-stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

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

@media (max-width: 768px) {
  .ra-page {
    padding: 1rem;
  }

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

  .ra-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.ra-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  overflow: hidden;
}

.ra-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  gap: 1rem;
  flex-wrap: wrap;
}

.ra-filters {
  display: flex;
  gap: .25rem;
}

.ra-filter-btn {
  padding: .5rem 1rem;
  border: none;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  border-radius: .5rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.ra-filter-btn:hover {
  background: #f8fafc;
  color: #334155;
}

.ra-filter-btn--active {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
}

.ra-toolbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.ra-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ra-search-icon {
  position: absolute;
  left: .75rem;
  color: #94a3b8;
  pointer-events: none;
}

.ra-search-input {
  padding: .5rem .75rem .5rem 2.25rem;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  font-family: inherit;
  font-size: .875rem;
  color: #334155;
  outline: none;
  width: 200px;
  background: #f8fafc;
  transition: border-color .15s;
}

.ra-search-input:focus {
  border-color: #6366f1;
  background: #fff;
}

.ra-filter-select {
  padding: .5rem .75rem;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  font-family: inherit;
  font-size: .8125rem;
  color: #475569;
  background: #f8fafc;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.ra-filter-select:focus {
  border-color: #6366f1;
}

.ra-table-wrap {
  overflow-x: auto;
}

.ra-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.ra-table thead th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .07em;
  color: #94a3b8;
  text-transform: uppercase;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.ra-table tbody tr {
  border-bottom: 1px solid #f8fafc;
  transition: background .1s;
}

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

.ra-table td {
  padding: .875rem 1rem;
  color: #334155;
  vertical-align: middle;
}

.ra-clickable-row {
  cursor: pointer;
}

.ra-clickable-row:hover {
  background: #fafbff;
}

.ra-employee-cell {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.ra-avatar {
  width: 36px;
  height: 36px;
  border-radius: .5rem;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ra-employee-name {
  font-weight: 600;
  color: #0f172a;
}

.ra-employee-sub {
  font-size: .75rem;
  color: #94a3b8;
  margin-top: 1px;
}

.ra-workload {
  display: inline-block;
  padding: .2rem .625rem;
  background: #ede9fe;
  color: #7c3aed;
  border-radius: .375rem;
  font-size: .8125rem;
  font-weight: 600;
}

.ra-status {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .25rem .625rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

.ra-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ra-status--active {
  background: #f0fdf4;
  color: #16a34a;
}

.ra-status--planned {
  background: #fff7ed;
  color: #c2410c;
}

.ra-status--completed {
  background: #f1f5f9;
  color: #64748b;
}

.ra-date-range {
  white-space: nowrap;
  font-size: .8125rem;
  color: #64748b;
}

.ra-row-actions {
  display: flex;
  gap: .375rem;
  align-items: center;
}

.ra-edit-btn,
.ra-delete-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  background: #fff;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.ra-edit-btn {
  color: #475569;
}

.ra-edit-btn:hover {
  background: #f1f5f9;
  color: #6366f1;
}

.ra-delete-btn {
  color: #94a3b8;
}

.ra-delete-btn:hover {
  background: #fff1f2;
  border-color: #fecaca;
  color: #e11d48;
}

.ra-empty-cell {
  padding: 3rem 1rem !important;
}

.ra-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  color: #94a3b8;
  text-align: center;
}

.ra-empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
  margin: 0;
}

.ra-empty-state p {
  font-size: .875rem;
  margin: 0;
}

.ra-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 1rem;
}

.ra-count {
  font-size: .875rem;
  color: #64748b;
}

.ra-count strong {
  color: #0f172a;
}

.ra-pagination {
  display: flex;
  gap: .25rem;
}

.ra-page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 .75rem;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  background: #fff;
  font-family: inherit;
  font-size: .8125rem;
  color: #475569;
  cursor: pointer;
  transition: all .15s;
}

.ra-page-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #6366f1;
  color: #6366f1;
}

.ra-page-btn--active {
  background: #6366f1 !important;
  color: #fff !important;
  border-color: #6366f1 !important;
  font-weight: 700;
}

.ra-page-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.of-input-with-unit {
  position: relative;
  display: flex;
}

.of-input-with-unit .of-input {
  flex: 1;
  padding-right: 3.5rem;
}

.of-unit-suffix {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .875rem;
  font-weight: 500;
  color: #64748b;
  pointer-events: none;
}

.of-alert--warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fed7aa;
  border-left: 4px solid #f59e0b;
}

.of-alert--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
}
/* ── Workflow paused/stopped state (cascades visually from a paused/stopped client) ── */
.wf-paused { opacity: .62; filter: grayscale(.7); transition: opacity .15s, filter .15s; }
.wf-paused:hover { opacity: .8; }
.wf-pause-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px;
  font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: #fef3c7; color: #92400e; white-space: nowrap; flex-shrink: 0;
}
.wf-pause-badge--stopped { background: #fee2e2; color: #b91c1c; }
.wf-pause-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; margin-bottom: 12px; border-radius: 10px;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  font-size: .8rem; font-weight: 600;
}
.wf-pause-banner--stopped { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
