/* ============================================================
   WorkGrid Modern UI Design System
   A comprehensive design foundation for the client-side area
   ============================================================ */

/* ----- CSS Custom Properties (Design Tokens) ----- */
:root {
  /* Background & Surface */
  --ui-bg: #f7f7fb;
  --ui-surface: #ffffff;
  --ui-surface-2: #f3f4ff;
  --ui-surface-3: #f8f9fc;

  /* Borders */
  --ui-border: rgba(15, 23, 42, 0.10);
  --ui-border-strong: rgba(15, 23, 42, 0.14);
  --ui-border-light: rgba(15, 23, 42, 0.06);

  /* Text */
  --ui-text: #0f172a;
  --ui-text-secondary: #334155;
  --ui-muted: #64748b;
  --ui-muted-light: #94a3b8;

  /* Brand / Primary */
  --ui-primary: #7c3aed;
  --ui-primary-2: #ec4899;
  --ui-primary-light: rgba(124, 58, 237, 0.10);
  --ui-primary-medium: rgba(124, 58, 237, 0.18);
  --ui-primary-contrast: #ffffff;

  /* Semantic Colors */
  --ui-success: #22c55e;
  --ui-success-light: rgba(34, 197, 94, 0.10);
  --ui-success-border: rgba(34, 197, 94, 0.22);
  --ui-warning: #f59e0b;
  --ui-warning-light: rgba(245, 158, 11, 0.12);
  --ui-warning-border: rgba(245, 158, 11, 0.24);
  --ui-danger: #ef4444;
  --ui-danger-light: rgba(239, 68, 68, 0.10);
  --ui-danger-border: rgba(239, 68, 68, 0.22);
  --ui-info: #38bdf8;
  --ui-info-light: rgba(56, 189, 248, 0.12);
  --ui-info-border: rgba(56, 189, 248, 0.22);

  /* Radii */
  --ui-radius-xs: 6px;
  --ui-radius-sm: 10px;
  --ui-radius: 14px;
  --ui-radius-lg: 18px;
  --ui-radius-xl: 24px;
  --ui-radius-full: 999px;

  /* Shadows */
  --ui-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --ui-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.06);
  --ui-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 10px 30px rgba(15, 23, 42, 0.08);
  --ui-shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.08), 0 18px 55px rgba(15, 23, 42, 0.16);
  --ui-shadow-xl: 0 4px 8px rgba(15, 23, 42, 0.10), 0 24px 70px rgba(15, 23, 42, 0.20);

  /* Transitions */
  --ui-transition-fast: 120ms ease;
  --ui-transition: 200ms ease;
  --ui-transition-slow: 350ms ease;

  /* Typography */
  --ui-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ui-font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

  /* Z-index scale */
  --z-sidebar: 1020;
  --z-header: 1010;
  --z-overlay: 1040;
  --z-modal: 1050;
  --z-toast: 1060;
  --z-tooltip: 1070;
}

/* ============================================================
   BASE / RESET
   ============================================================ */

html,
body {
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: var(--ui-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(124, 58, 237, 0.18);
  color: var(--ui-text);
}

/* ----- Custom Scrollbar ----- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.28);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.18) transparent;
}

/* ----- Focus Ring ----- */
:where(a, button, input, select, textarea, [role="button"], .btn):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18), 0 0 0 1px rgba(124, 58, 237, 0.45);
  border-radius: var(--ui-radius-sm);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--ui-text);
  letter-spacing: -0.01em;
}

h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.125rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: 0.875rem; }

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

.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

/* ============================================================
   LAYOUT
   ============================================================ */

/* Admin layout */
#wrapper {
  background: var(--ui-bg);
}

.content {
  padding: 24px;
}

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

/* ----- Page Header ----- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ui-border-light);
}

.page-header h1,
.page-header h2,
.page-header h3,
.page-header h4 {
  margin: 0;
  font-weight: 700;
}

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

/* ----- Page Section ----- */
.page-section {
  margin-bottom: 28px;
}

.page-section:last-child {
  margin-bottom: 0;
}

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

.page-section-header h3,
.page-section-header h4 {
  margin: 0;
}

/* ----- Two Column Layout ----- */
.two-column-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

/* ----- Sidebar + Content Layout ----- */
.sidebar-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

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

/* ============================================================
   HEADER / NAVBAR
   ============================================================ */

#header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--ui-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

/* Clients navigation */
.navbar.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--ui-border);
}

.navbar.header.navbar-default {
  border: 0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.navbar.header .navbar-nav > li > a {
  border-radius: var(--ui-radius-full);
  margin: 10px 4px;
  padding: 8px 14px;
  color: rgba(15, 23, 42, 0.76);
  font-weight: 500;
  font-size: 0.875rem;
  transition: background-color var(--ui-transition-fast), color var(--ui-transition-fast);
}

.navbar.header .navbar-nav > li > a:hover,
.navbar.header .navbar-nav > li.active > a {
  background: var(--ui-primary-light);
  color: rgba(15, 23, 42, 0.95);
}

.navbar.header .navbar-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ui-text);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar.header .navbar-brand img {
  max-height: 32px;
  width: auto;
}

.navbar.header .navbar-toggle {
  border-radius: var(--ui-radius-sm);
  border: 1px solid var(--ui-border);
  margin-top: 10px;
  margin-bottom: 10px;
}

.navbar.header .navbar-toggle .icon-bar {
  background-color: var(--ui-text);
}

/* ============================================================
   SIDEBAR (Admin)
   ============================================================ */

aside#menu.sidebar {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.03) 40%, rgba(255, 255, 255, 0));
  border-right: 1px solid var(--ui-border);
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.04);
}

#side-menu > li > a {
  border-radius: var(--ui-radius-sm);
  margin: 2px 10px;
  padding: 10px 12px;
  color: rgba(15, 23, 42, 0.78);
  font-weight: 500;
  position: relative;
  transition: background-color var(--ui-transition-fast), color var(--ui-transition-fast), box-shadow var(--ui-transition-fast);
}

#side-menu > li > a:hover,
#side-menu > li.active > a,
#side-menu > li.mm-active > a {
  background: var(--ui-primary-light);
  color: rgba(15, 23, 42, 0.95);
  box-shadow: inset 3px 0 0 rgba(124, 58, 237, 0.85);
}

#side-menu > li > a .menu-icon {
  opacity: 0.85;
}

#side-menu > li > a:hover .menu-icon,
#side-menu > li.active > a .menu-icon,
#side-menu > li.mm-active > a .menu-icon {
  opacity: 1;
}

#side-menu .nav-second-level {
  margin: 6px 10px 10px 10px;
  padding: 6px;
  border-radius: var(--ui-radius-sm);
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid var(--ui-border);
}

#side-menu .nav-second-level > li > a {
  border-radius: var(--ui-radius-xs);
  padding: 8px 10px;
  font-size: 0.875rem;
  transition: background-color var(--ui-transition-fast), color var(--ui-transition-fast), box-shadow var(--ui-transition-fast);
}

#side-menu .nav-second-level > li > a:hover,
#side-menu .nav-second-level > li.active > a {
  background: var(--ui-primary-light);
}

/* ============================================================
   CARDS / PANELS
   ============================================================ */

.panel,
.panel_s,
.bgwhite,
.card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  transition: box-shadow var(--ui-transition), border-color var(--ui-transition);
}

.panel:hover,
.panel_s:hover {
  box-shadow: var(--ui-shadow-lg);
}

.panel-heading {
  background: rgba(243, 244, 255, 0.75);
  border-bottom: 1px solid var(--ui-border);
  border-top-left-radius: var(--ui-radius);
  border-top-right-radius: var(--ui-radius);
  padding: 16px 20px;
}

.panel-heading .panel-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ui-text);
}

.panel-body {
  padding: 20px;
}

.panel-footer {
  background: rgba(243, 244, 255, 0.55);
  border-top: 1px solid var(--ui-border);
  border-bottom-left-radius: var(--ui-radius);
  border-bottom-right-radius: var(--ui-radius);
  padding: 14px 20px;
}

/* ----- Card Variants ----- */
.card-hover {
  cursor: pointer;
  transition: transform var(--ui-transition), box-shadow var(--ui-transition), border-color var(--ui-transition);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--ui-shadow-lg);
  border-color: var(--ui-primary-medium);
}

.card-interactive {
  cursor: pointer;
  transition: background-color var(--ui-transition-fast), border-color var(--ui-transition-fast);
}

.card-interactive:hover {
  background: var(--ui-surface-2);
  border-color: var(--ui-border-strong);
}

.card-interactive:active {
  background: var(--ui-primary-light);
}

/* ----- Stat Card ----- */
.card-stat {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-stat .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--ui-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

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

.card-stat .stat-icon.success {
  background: var(--ui-success-light);
  color: var(--ui-success);
}

.card-stat .stat-icon.warning {
  background: var(--ui-warning-light);
  color: var(--ui-warning);
}

.card-stat .stat-icon.danger {
  background: var(--ui-danger-light);
  color: var(--ui-danger);
}

.card-stat .stat-icon.info {
  background: var(--ui-info-light);
  color: var(--ui-info);
}

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

.card-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ui-text);
}

.card-stat .stat-label {
  font-size: 0.8125rem;
  color: var(--ui-muted);
  margin-top: 2px;
}

/* ----- Stat Cards Grid ----- */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 576px) {
  .stat-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   TABLES
   ============================================================ */

.table,
table.table {
  background: var(--ui-surface);
  margin-bottom: 0;
}

.table > thead > tr > th,
table.table > thead > tr > th {
  background: rgba(243, 244, 255, 0.70);
  color: rgba(15, 23, 42, 0.72);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--ui-border);
  padding: 12px 16px;
  white-space: nowrap;
}

.table > tbody > tr > td,
.table > tbody > tr > th,
table.table > tbody > tr > td,
table.table > tbody > tr > th {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--ui-text-secondary);
  font-size: 0.875rem;
}

.table > tbody > tr:hover,
table.table > tbody > tr:hover {
  background: rgba(124, 58, 237, 0.04);
}

.table > tbody > tr:last-child > td,
table.table > tbody > tr:last-child > td {
  border-bottom: 0;
}

/* Table responsive wrapper */
.table-responsive {
  border: 0;
  border-radius: var(--ui-radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table inside panel */
.panel .table,
.panel_s .table {
  margin-bottom: 0;
}

.panel .table > thead > tr:first-child > th:first-child,
.panel_s .table > thead > tr:first-child > th:first-child {
  border-top-left-radius: var(--ui-radius);
}

.panel .table > thead > tr:first-child > th:last-child,
.panel_s .table > thead > tr:first-child > th:last-child {
  border-top-right-radius: var(--ui-radius);
}

/* ============================================================
   DROPDOWNS
   ============================================================ */

.dropdown-menu {
  border-radius: var(--ui-radius-sm);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow-lg);
  padding: 6px;
  min-width: 180px;
  animation: dropdownFadeIn 150ms ease;
}

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

.dropdown-menu > li > a {
  border-radius: var(--ui-radius-xs);
  padding: 9px 12px;
  color: rgba(15, 23, 42, 0.88);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color var(--ui-transition-fast), color var(--ui-transition-fast);
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  background: var(--ui-primary-light);
  color: var(--ui-text);
}

.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
  background: var(--ui-primary-light);
  color: var(--ui-primary);
}

.dropdown-menu .divider {
  margin: 6px 0;
  background-color: var(--ui-border-light);
}

/* ============================================================
   MODALS
   ============================================================ */

.modal-content {
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow-xl);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--ui-border);
  background: rgba(243, 244, 255, 0.70);
  border-top-left-radius: var(--ui-radius-lg);
  border-top-right-radius: var(--ui-radius-lg);
  padding: 16px 24px;
}

.modal-header .modal-title {
  font-weight: 700;
  font-size: 1.125rem;
}

.modal-header .close {
  opacity: 0.5;
  transition: opacity var(--ui-transition-fast);
  font-size: 1.25rem;
}

.modal-header .close:hover {
  opacity: 0.8;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--ui-border);
  background: rgba(243, 244, 255, 0.50);
  border-bottom-left-radius: var(--ui-radius-lg);
  border-bottom-right-radius: var(--ui-radius-lg);
  padding: 14px 24px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Modal animation */
.modal.fade .modal-dialog {
  transform: scale(0.95);
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease;
}

.modal.fade.in .modal-dialog {
  transform: scale(1);
  opacity: 1;
}

/* Modal backdrop */
.modal-backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ============================================================
   BUTTONS
   ============================================================ */

/* Primary - Gradient */
.btn-primary,
.btn.btn-primary {
  border: 0;
  color: var(--ui-primary-contrast) !important;
  background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2));
  box-shadow: 0 10px 20px rgba(124, 58, 237, 0.20);
  font-weight: 600;
  border-radius: var(--ui-radius-sm);
  padding: 8px 18px;
  transition: filter var(--ui-transition-fast), box-shadow var(--ui-transition-fast), transform var(--ui-transition-fast);
}

.btn-primary:hover,
.btn.btn-primary:hover {
  filter: brightness(0.98);
  box-shadow: 0 12px 26px rgba(124, 58, 237, 0.28);
  transform: translateY(-1px);
}

.btn-primary:active,
.btn.btn-primary:active {
  filter: brightness(0.94);
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.18);
}

/* Default / Secondary */
.btn-default,
.btn.btn-default {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--ui-text-secondary) !important;
  font-weight: 500;
  border-radius: var(--ui-radius-sm);
  padding: 8px 18px;
  transition: background-color var(--ui-transition-fast), border-color var(--ui-transition-fast), box-shadow var(--ui-transition-fast);
}

.btn-default:hover,
.btn.btn-default:hover {
  background: rgba(243, 244, 255, 0.70) !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
  box-shadow: var(--ui-shadow-xs);
}

/* Success */
.btn-success,
.btn.btn-success {
  border: 0;
  background: var(--ui-success);
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--ui-radius-sm);
  box-shadow: 0 8px 16px rgba(34, 197, 94, 0.20);
  transition: filter var(--ui-transition-fast), box-shadow var(--ui-transition-fast), transform var(--ui-transition-fast);
}

.btn-success:hover,
.btn.btn-success:hover {
  filter: brightness(0.95);
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.28);
  transform: translateY(-1px);
}

/* Danger */
.btn-danger,
.btn.btn-danger {
  border: 0;
  background: var(--ui-danger);
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--ui-radius-sm);
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.20);
  transition: filter var(--ui-transition-fast), box-shadow var(--ui-transition-fast), transform var(--ui-transition-fast);
}

.btn-danger:hover,
.btn.btn-danger:hover {
  filter: brightness(0.95);
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.28);
  transform: translateY(-1px);
}

/* Warning */
.btn-warning,
.btn.btn-warning {
  border: 0;
  background: var(--ui-warning);
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--ui-radius-sm);
  box-shadow: 0 8px 16px rgba(245, 158, 11, 0.20);
  transition: filter var(--ui-transition-fast), box-shadow var(--ui-transition-fast), transform var(--ui-transition-fast);
}

.btn-warning:hover,
.btn.btn-warning:hover {
  filter: brightness(0.95);
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.28);
  transform: translateY(-1px);
}

/* Info */
.btn-info,
.btn.btn-info {
  border: 0;
  background: var(--ui-info);
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--ui-radius-sm);
  box-shadow: 0 8px 16px rgba(56, 189, 248, 0.20);
  transition: filter var(--ui-transition-fast), box-shadow var(--ui-transition-fast), transform var(--ui-transition-fast);
}

.btn-info:hover,
.btn.btn-info:hover {
  filter: brightness(0.95);
  box-shadow: 0 10px 22px rgba(56, 189, 248, 0.28);
  transform: translateY(-1px);
}

/* ----- Button Sizes ----- */
.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: var(--ui-radius);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8125rem;
  border-radius: var(--ui-radius-xs);
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.75rem;
  border-radius: var(--ui-radius-xs);
}

/* ----- Icon Button ----- */
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ui-radius-sm);
}

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

.btn-icon.btn-lg {
  width: 48px;
  height: 48px;
}

/* ----- Button Group ----- */
.btn-group > .btn {
  border-radius: 0;
}

.btn-group > .btn:first-child {
  border-top-left-radius: var(--ui-radius-sm);
  border-bottom-left-radius: var(--ui-radius-sm);
}

.btn-group > .btn:last-child {
  border-top-right-radius: var(--ui-radius-sm);
  border-bottom-right-radius: var(--ui-radius-sm);
}

/* ----- Disabled State ----- */
.btn:disabled,
.btn.disabled,
.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(0.3);
}

/* ============================================================
   FORMS
   ============================================================ */

.form-control {
  border-radius: var(--ui-radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  padding: 9px 14px;
  font-size: 0.875rem;
  color: var(--ui-text);
  transition: border-color var(--ui-transition-fast), box-shadow var(--ui-transition-fast), background-color var(--ui-transition-fast);
  box-shadow: none;
  height: auto;
  line-height: 1.5;
}

.form-control:focus {
  border-color: rgba(124, 58, 237, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
  background: #fff;
  outline: none;
}

.form-control::placeholder {
  color: var(--ui-muted-light);
}

.form-control:disabled,
.form-control[readonly] {
  background: rgba(243, 244, 255, 0.50);
  opacity: 0.7;
}

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

/* ----- Form Group ----- */
.form-group {
  margin-bottom: 20px;
}

.form-group label,
.form-group .control-label {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--ui-text-secondary);
  margin-bottom: 6px;
  display: block;
}

.form-group label .req,
.form-group .control-label .req {
  color: var(--ui-danger);
}

/* ----- Input Group ----- */
.input-group .form-control {
  border-radius: var(--ui-radius-sm) 0 0 var(--ui-radius-sm);
}

.input-group .input-group-addon {
  border-radius: 0 var(--ui-radius-sm) var(--ui-radius-sm) 0;
  background: rgba(243, 244, 255, 0.60);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-left: 0;
  color: var(--ui-muted);
  font-size: 0.875rem;
}

.input-group .input-group-btn > .btn {
  border-radius: 0 var(--ui-radius-sm) var(--ui-radius-sm) 0;
}

/* ----- Checkbox & Radio ----- */
.checkbox label,
.radio label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--ui-text-secondary);
  padding-left: 0;
}

.checkbox input[type="checkbox"],
.radio input[type="radio"] {
  margin-right: 8px;
}

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

/* ----- Form Validation States ----- */
.has-error .form-control {
  border-color: var(--ui-danger-border);
}

.has-error .form-control:focus {
  border-color: var(--ui-danger);
  box-shadow: 0 0 0 3px var(--ui-danger-light);
}

.has-error .help-block,
.has-error .control-label {
  color: var(--ui-danger);
}

.has-success .form-control {
  border-color: var(--ui-success-border);
}

.has-success .form-control:focus {
  border-color: var(--ui-success);
  box-shadow: 0 0 0 3px var(--ui-success-light);
}

/* ----- Help Block ----- */
.help-block {
  font-size: 0.8125rem;
  color: var(--ui-muted);
  margin-top: 4px;
}

/* ============================================================
   BADGES / LABELS / ALERTS
   ============================================================ */

.badge,
.label {
  border-radius: var(--ui-radius-full) !important;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge {
  background: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.82);
}

/* Badge color variants */
.badge-success,
.label-success {
  background: var(--ui-success-light);
  color: #15803d;
}

.badge-warning,
.label-warning {
  background: var(--ui-warning-light);
  color: #b45309;
}

.badge-danger,
.label-danger {
  background: var(--ui-danger-light);
  color: #b91c1c;
}

.badge-info,
.label-info {
  background: var(--ui-info-light);
  color: #0369a1;
}

.badge-primary,
.label-primary {
  background: var(--ui-primary-light);
  color: var(--ui-primary);
}

/* ----- Alerts ----- */
.alert {
  border-radius: var(--ui-radius);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow-xs);
  padding: 14px 18px;
  font-size: 0.875rem;
}

.alert-success {
  background: var(--ui-success-light);
  border-color: var(--ui-success-border);
  color: #15803d;
}

.alert-info {
  background: var(--ui-info-light);
  border-color: var(--ui-info-border);
  color: #0369a1;
}

.alert-warning {
  background: var(--ui-warning-light);
  border-color: var(--ui-warning-border);
  color: #b45309;
}

.alert-danger {
  background: var(--ui-danger-light);
  border-color: var(--ui-danger-border);
  color: #b91c1c;
}

.alert .close {
  opacity: 0.5;
  transition: opacity var(--ui-transition-fast);
}

.alert .close:hover {
  opacity: 0.8;
}

/* ============================================================
   TABS
   ============================================================ */

.nav-tabs {
  border-bottom: 1px solid var(--ui-border);
  gap: 2px;
}

.nav-tabs > li > a {
  border: 1px solid transparent;
  margin-right: 4px;
  padding: 10px 16px;
  color: rgba(15, 23, 42, 0.70);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--ui-radius-sm) var(--ui-radius-sm) 0 0;
  transition: background-color var(--ui-transition-fast), color var(--ui-transition-fast), border-color var(--ui-transition-fast);
}

.nav-tabs > li > a:hover {
  background: rgba(124, 58, 237, 0.06);
  border-color: transparent;
  color: var(--ui-text);
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  background: var(--ui-primary-light);
  border-color: var(--ui-border) var(--ui-border) transparent;
  color: var(--ui-text);
  font-weight: 600;
}

/* Tab content */
.tab-content {
  padding: 20px 0 0;
}

.tab-content > .tab-pane {
  animation: tabFadeIn 200ms ease;
}

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

/* Force remove border-radius from all nav-tabs hover states */
.nav-tabs > li > a:hover,
.nav-tabs > li > a:focus,
.nav-tabs > li > a:active,
.nav-tabs > li:hover > a,
.nav-tabs li a:hover,
.nav-tabs li:hover a,
.nav-tabs a:hover,
body .nav-tabs > li > a:hover,
body .nav-tabs > li > a:focus,
body .nav-tabs li a:hover {
  border-radius: var(--ui-radius-sm) var(--ui-radius-sm) 0 0 !important;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  margin: 16px 0 0;
}

.pagination > li > a,
.pagination > li > span {
  border-radius: var(--ui-radius-sm) !important;
  margin: 0 3px;
  border: 1px solid var(--ui-border) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: rgba(15, 23, 42, 0.78) !important;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 7px 13px;
  transition: background-color var(--ui-transition-fast), color var(--ui-transition-fast), border-color var(--ui-transition-fast);
}

.pagination > li > a:hover,
.pagination > li > span:hover {
  background: rgba(243, 244, 255, 0.70) !important;
  border-color: var(--ui-border-strong) !important;
}

.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
  border: 0 !important;
  color: var(--ui-primary-contrast) !important;
  background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2)) !important;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.18);
}

.pagination > .disabled > span,
.pagination > .disabled > a {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */

.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0 0 16px;
  font-size: 0.8125rem;
}

.breadcrumb > li + li:before {
  content: '›';
  color: var(--ui-muted-light);
  padding: 0 8px;
  font-weight: 700;
}

.breadcrumb > li a {
  color: var(--ui-muted);
  font-weight: 500;
  transition: color var(--ui-transition-fast);
}

.breadcrumb > li a:hover {
  color: var(--ui-primary);
  text-decoration: none;
}

.breadcrumb > .active {
  color: var(--ui-text);
  font-weight: 600;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state .empty-state-icon {
  font-size: 3rem;
  color: var(--ui-muted-light);
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state .empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ui-text);
  margin-bottom: 8px;
}

.empty-state .empty-state-description {
  font-size: 0.875rem;
  color: var(--ui-muted);
  max-width: 400px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* ============================================================
   STANDALONE PAGE (Login, Register, etc.)
   ============================================================ */

.standalone-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--ui-bg);
  position: relative;
  overflow: hidden;
}

/* Animated gradient background for standalone pages */
.standalone-page.standalone-gradient {
  background: linear-gradient(135deg, #f0f0ff 0%, #fdf2f8 30%, #f7f7fb 60%, #ede9fe 100%);
}

.standalone-page .standalone-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.standalone-page .standalone-container.standalone-wide {
  max-width: 560px;
}

.standalone-page .standalone-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-xl);
  box-shadow: var(--ui-shadow-xl);
  padding: 36px 32px;
  animation: cardSlideUp 400ms ease;
}

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

.standalone-page .standalone-logo {
  text-align: center;
  margin-bottom: 28px;
}

.standalone-page .standalone-logo img {
  max-height: 48px;
  width: auto;
}

.standalone-page .standalone-logo h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 12px 0 4px;
  background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.standalone-page .standalone-logo p {
  color: var(--ui-muted);
  font-size: 0.875rem;
  margin: 0;
}

.standalone-page .standalone-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--ui-muted);
}

.standalone-page .standalone-footer a {
  color: var(--ui-primary);
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--ui-transition-fast);
}

.standalone-page .standalone-footer a:hover {
  opacity: 0.8;
}

/* Floating decorative spheres for standalone pages */
.standalone-bg-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.standalone-bg-sphere.sphere-1 {
  width: 400px;
  height: 400px;
  background: var(--ui-primary);
  top: -100px;
  right: -100px;
  animation: sphereFloat1 20s ease-in-out infinite;
}

.standalone-bg-sphere.sphere-2 {
  width: 300px;
  height: 300px;
  background: var(--ui-primary-2);
  bottom: -80px;
  left: -80px;
  animation: sphereFloat2 25s ease-in-out infinite;
}

.standalone-bg-sphere.sphere-3 {
  width: 200px;
  height: 200px;
  background: var(--ui-primary);
  top: 50%;
  left: 50%;
  animation: sphereFloat3 18s ease-in-out infinite;
}

@keyframes sphereFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes sphereFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-25px, 25px) scale(1.08); }
  66% { transform: translate(20px, -15px) scale(0.92); }
}

@keyframes sphereFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(15px, -20px) scale(1.1); }
}

/* ============================================================
   PROFILE / AVATAR
   ============================================================ */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--ui-radius-full);
  object-fit: cover;
  border: 2px solid var(--ui-border);
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 96px; height: 96px; }

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ui-primary-light);
  color: var(--ui-primary);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
}

.avatar-placeholder.avatar-lg { font-size: 1.5rem; }
.avatar-placeholder.avatar-xl { font-size: 2rem; }

/* ============================================================
   STATUS INDICATORS
   ============================================================ */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--ui-radius-full);
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.success { background: var(--ui-success); }
.status-dot.warning { background: var(--ui-warning); }
.status-dot.danger { background: var(--ui-danger); }
.status-dot.info { background: var(--ui-info); }
.status-dot.muted { background: var(--ui-muted-light); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--ui-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.success {
  background: var(--ui-success-light);
  color: #15803d;
}

.status-badge.warning {
  background: var(--ui-warning-light);
  color: #b45309;
}

.status-badge.danger {
  background: var(--ui-danger-light);
  color: #b91c1c;
}

.status-badge.info {
  background: var(--ui-info-light);
  color: #0369a1;
}

.status-badge.neutral {
  background: rgba(15, 23, 42, 0.06);
  color: var(--ui-muted);
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.progress {
  height: 8px;
  border-radius: var(--ui-radius-full);
  background: rgba(15, 23, 42, 0.06);
  box-shadow: none;
  overflow: hidden;
}

.progress-bar {
  border-radius: var(--ui-radius-full);
  background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2));
  box-shadow: none;
  transition: width 400ms ease;
}

.progress-bar-success { background: var(--ui-success); }
.progress-bar-warning { background: var(--ui-warning); }
.progress-bar-danger { background: var(--ui-danger); }
.progress-bar-info { background: var(--ui-info); }

/* ============================================================
   TIMELINE / ACTIVITY FEED
   ============================================================ */

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--ui-border);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: var(--ui-radius-full);
  background: var(--ui-primary);
  border: 2px solid var(--ui-surface);
  box-shadow: 0 0 0 2px var(--ui-primary-light);
}

.timeline-item .timeline-time {
  font-size: 0.75rem;
  color: var(--ui-muted-light);
  margin-bottom: 4px;
}

.timeline-item .timeline-content {
  font-size: 0.875rem;
  color: var(--ui-text-secondary);
  line-height: 1.5;
}

/* ============================================================
   FILE UPLOAD ZONE
   ============================================================ */

.file-upload-zone {
  border: 2px dashed var(--ui-border-strong);
  border-radius: var(--ui-radius);
  padding: 32px 24px;
  text-align: center;
  background: rgba(243, 244, 255, 0.40);
  transition: border-color var(--ui-transition), background-color var(--ui-transition);
  cursor: pointer;
}

.file-upload-zone:hover,
.file-upload-zone.dz-drag-hover {
  border-color: var(--ui-primary);
  background: var(--ui-primary-light);
}

.file-upload-zone .upload-icon {
  font-size: 2.5rem;
  color: var(--ui-muted-light);
  margin-bottom: 12px;
}

.file-upload-zone .upload-text {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ui-text);
  margin-bottom: 4px;
}

.file-upload-zone .upload-hint {
  font-size: 0.8125rem;
  color: var(--ui-muted);
}

/* ============================================================
   COMMENTS / CHAT
   ============================================================ */

.comment-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ui-border-light);
}

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

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

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

.comment-item .comment-author {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ui-text);
  margin-bottom: 2px;
}

.comment-item .comment-time {
  font-size: 0.75rem;
  color: var(--ui-muted-light);
  margin-bottom: 6px;
}

.comment-item .comment-text {
  font-size: 0.875rem;
  color: var(--ui-text-secondary);
  line-height: 1.6;
}

/* ============================================================
   TOOLTIP
   ============================================================ */

.tooltip-inner {
  border-radius: var(--ui-radius-xs);
  background: var(--ui-text);
  color: #fff;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: var(--ui-shadow-lg);
}

.tooltip.top .tooltip-arrow {
  border-top-color: var(--ui-text);
}

.tooltip.bottom .tooltip-arrow {
  border-bottom-color: var(--ui-text);
}

.tooltip.left .tooltip-arrow {
  border-left-color: var(--ui-text);
}

.tooltip.right .tooltip-arrow {
  border-right-color: var(--ui-text);
}

/* ============================================================
   LOADING / SKELETON
   ============================================================ */

.skeleton {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.06) 25%, rgba(15, 23, 42, 0.10) 50%, rgba(15, 23, 42, 0.06) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--ui-radius-xs);
}

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

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

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

.skeleton-title {
  height: 20px;
  width: 40%;
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--ui-radius-full);
}

.skeleton-card {
  height: 120px;
  border-radius: var(--ui-radius);
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--ui-border);
  border-top-color: var(--ui-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 36px; height: 36px; border-width: 4px; }

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

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  padding: 20px 24px;
  border-top: 1px solid var(--ui-border-light);
  background: rgba(255, 255, 255, 0.60);
  font-size: 0.8125rem;
  color: var(--ui-muted);
  text-align: center;
}

.footer a {
  color: var(--ui-primary);
  font-weight: 500;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ============================================================
   BACK BUTTON
   ============================================================ */

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ui-muted);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--ui-radius-sm);
  transition: color var(--ui-transition-fast), background-color var(--ui-transition-fast);
  margin-bottom: 16px;
}

.back-button:hover {
  color: var(--ui-text);
  background: rgba(15, 23, 42, 0.04);
  text-decoration: none;
}

.back-button i {
  font-size: 0.75rem;
}

/* ============================================================
   DIVIDER
   ============================================================ */

.divider {
  border: 0;
  border-top: 1px solid var(--ui-border-light);
  margin: 20px 0;
}

.divider-sm { margin: 12px 0; }
.divider-lg { margin: 32px 0; }

.divider-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ui-muted-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ui-border);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Spacing */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.mt-5 { margin-top: 24px !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-5 { margin-bottom: 24px !important; }
.mr-2 { margin-right: 8px !important; }
.mr-3 { margin-right: 12px !important; }
.ml-2 { margin-left: 8px !important; }
.ml-3 { margin-left: 12px !important; }

.p-0 { padding: 0 !important; }
.p-3 { padding: 12px !important; }
.p-4 { padding: 16px !important; }
.p-5 { padding: 24px !important; }
.px-4 { padding-left: 16px !important; padding-right: 16px !important; }
.py-3 { padding-top: 12px !important; padding-bottom: 12px !important; }
.py-4 { padding-top: 16px !important; padding-bottom: 16px !important; }

/* Flex */
.d-flex { display: flex !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-end { justify-content: flex-end !important; }
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.gap-5 { gap: 24px !important; }

/* Text alignment */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Width */
.w-full { width: 100% !important; }
.w-auto { width: auto !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }

/* Overflow */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }

/* Position */
.relative { position: relative !important; }

/* Rounded */
.rounded-sm { border-radius: var(--ui-radius-xs) !important; }
.rounded { border-radius: var(--ui-radius-sm) !important; }
.rounded-lg { border-radius: var(--ui-radius) !important; }
.rounded-xl { border-radius: var(--ui-radius-lg) !important; }
.rounded-full { border-radius: var(--ui-radius-full) !important; }

/* Shadow */
.shadow-none { box-shadow: none !important; }
.shadow-sm { box-shadow: var(--ui-shadow-sm) !important; }
.shadow { box-shadow: var(--ui-shadow) !important; }
.shadow-lg { box-shadow: var(--ui-shadow-lg) !important; }

/* Border */
.border-0 { border: 0 !important; }
.border { border: 1px solid var(--ui-border) !important; }
.border-top { border-top: 1px solid var(--ui-border-light) !important; }
.border-bottom { border-bottom: 1px solid var(--ui-border-light) !important; }

/* Background */
.bg-white { background: var(--ui-surface) !important; }
.bg-light { background: var(--ui-surface-2) !important; }
.bg-transparent { background: transparent !important; }

/* Cursor */
.cursor-pointer { cursor: pointer !important; }

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

/* ============================================================
   CLIENTS AREA SPECIFIC
   ============================================================ */

body.customers,
body.clients,
body.customer_profile {
  background: var(--ui-bg);
}

/* Client dashboard widgets */
.client-dashboard-widget {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  padding: 20px;
  transition: box-shadow var(--ui-transition);
}

.client-dashboard-widget:hover {
  box-shadow: var(--ui-shadow-lg);
}

/* Project overview cards */
.project-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-sm);
  overflow: hidden;
  transition: transform var(--ui-transition), box-shadow var(--ui-transition);
}

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

.project-card .project-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ui-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card .project-card-body {
  padding: 16px 20px;
}

.project-card .project-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--ui-border-light);
  background: rgba(243, 244, 255, 0.40);
}

/* Ticket list items */
.ticket-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ui-border-light);
  transition: background-color var(--ui-transition-fast);
}

.ticket-list-item:last-child {
  border-bottom: 0;
}

.ticket-list-item:hover {
  background: rgba(124, 58, 237, 0.03);
}

/* File list items */
.file-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--ui-radius-sm);
  transition: background-color var(--ui-transition-fast);
}

.file-list-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

/* Announcement item */
.announcement-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ui-border-light);
  transition: background-color var(--ui-transition-fast);
}

.announcement-item:last-child {
  border-bottom: 0;
}

.announcement-item:hover {
  background: rgba(124, 58, 237, 0.03);
}

.announcement-item.unread {
  border-left: 3px solid var(--ui-primary);
  background: var(--ui-primary-light);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

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

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

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

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

  .page-header .page-header-actions .btn {
    flex: 1;
  }

  .standalone-page .standalone-card {
    padding: 24px 20px;
  }

  .stat-cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header,
  .modal-footer {
    padding: 12px 16px;
  }
}

@media (max-width: 576px) {
  .stat-cards-grid {
    grid-template-columns: 1fr;
  }

  .standalone-page {
    padding: 16px;
  }

  .standalone-page .standalone-card {
    padding: 20px 16px;
    border-radius: var(--ui-radius);
  }

  .two-column-layout {
    grid-template-columns: 1fr;
  }

  .btn-group-justified {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .btn-group-justified .btn {
    width: 100%;
    border-radius: var(--ui-radius-sm) !important;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .navbar.header,
  #header,
  .sidebar,
  #menu,
  .btn,
  .no-print {
    display: none !important;
  }

  .content {
    padding: 0 !important;
  }

  .panel,
  .panel_s {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

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

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
  :root {
    --ui-border: rgba(15, 23, 42, 0.20);
    --ui-border-strong: rgba(15, 23, 42, 0.30);
    --ui-muted: #334155;
    --ui-muted-light: #475569;
  }
}

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