/* ============================================
   MOBILYA CRM - DESIGN SYSTEM
   Modern, Corporate, High-UX Internal Tool
   ============================================ */

/* === CSS VARIABLES === */
:root {
  /* Colors - Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --bg-hover: #e9ecef;

  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --text-inverse: #ffffff;

  --border-light: #e9ecef;
  --border-medium: #dee2e6;
  --border-dark: #ced4da;

  --primary: #4263eb;
  --primary-hover: #3b5bdb;
  --primary-light: #dbe4ff;

  --success: #2b8a3e;
  --success-light: #d3f9d8;
  --warning: #f08c00;
  --warning-light: #fff3bf;
  --danger: #e03131;
  --danger-light: #ffe3e3;
  --info: #1c7ed6;
  --info-light: #d0ebff;

  /* Pipeline Stage Colors */
  --stage-lead: #868e96;
  --stage-offer-preparing: #1c7ed6;
  --stage-offer-ready: #4263eb;
  --stage-presentation: #7950f2;
  --stage-presented: #f08c00;
  --stage-waiting: #fd7e14;
  --stage-approved: #2b8a3e;
  --stage-rejected: #e03131;
  --stage-hold: #495057;
  --stage-cancelled: #343a40;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

  /* Spacing - 8px system */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

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

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;

  /* Layout */
  --topbar-height: 64px;

  /* Z-index scale */
  --z-topbar: 110;
  --z-drawer: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root[data-theme="dark"] {
    --bg-primary: #1a1b1e;
    --bg-secondary: #25262b;
    --bg-tertiary: #2c2e33;
    --bg-hover: #373a40;

    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --text-muted: #6c757d;

    --border-light: #373a40;
    --border-medium: #495057;
    --border-dark: #5c5f66;
  }
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

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

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

/* === LAYOUT === */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-height: 100vh;
}

.app-topbar {
  height: var(--topbar-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  gap: var(--space-3);
}

/* === TOPBAR COMPONENTS === */

/* Logo */
.topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.topbar-logo-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex-shrink: 0;
}

.topbar-logo-text {
  display: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s;
  margin-left: auto;
}

.mobile-menu-toggle:hover {
  background-color: var(--bg-hover);
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-primary);
}

/* Navigation */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
}

.topbar-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
  border: none;
}

.topbar-nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.topbar-nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.topbar-nav-item .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.topbar-nav-item.active .nav-icon {
  opacity: 1;
}

.dropdown-arrow {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  transition: transform 0.2s;
  flex-shrink: 0;
}

/* Dropdown */
.topbar-nav-dropdown {
  position: relative;
}

.topbar-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: var(--space-1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 1000;
}

.topbar-nav-dropdown:hover .topbar-dropdown-menu,
.topbar-nav-dropdown:focus-within .topbar-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.topbar-nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.topbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
}

.topbar-dropdown-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.topbar-dropdown-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.topbar-dropdown-item .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.topbar-dropdown-item.active .nav-icon {
  opacity: 1;
}

/* Right Section */
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

/* Search */
.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 240px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--bg-primary);
  width: 300px;
}

/* Actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.notification-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
}

/* User Menu */
.user-menu-wrapper {
  position: relative;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.15s;
}

.user-menu-button:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-medium);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  text-align: left;
  line-height: 1.3;
}

.user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.user-email {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-topbar) - 1);
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

.app-content {
  padding: var(--space-3);
}

/* Split View Layout */
.split-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: var(--space-2);
  height: calc(100vh - var(--topbar-height) - var(--space-3) * 2);
}

.split-list {
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  border: 1px solid var(--border-light);
}

.split-detail {
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  border: 1px solid var(--border-light);
  padding: var(--space-3);
}


.nav-section {
  margin-bottom: var(--space-3);
}

.nav-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0 var(--space-2);
  margin-bottom: var(--space-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  margin: 0 var(--space-1);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
}

.nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

/* === TOPBAR === */
.topbar-search {
  flex: 1;
  max-width: 500px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

/* === TYPOGRAPHY === */
.h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 10px var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--border-medium);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}

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

.btn-danger {
  background-color: var(--danger);
  color: var(--text-inverse);
}

.btn-danger:hover {
  background-color: #c92a2a;
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 12px var(--space-3);
  font-size: var(--text-base);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

/* === STATUS CHIPS === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Pipeline Stage Chips */
.chip-lead { background-color: #f1f3f5; color: var(--stage-lead); }
.chip-lead .chip-dot { background-color: var(--stage-lead); }

.chip-offer-preparing { background-color: var(--info-light); color: var(--stage-offer-preparing); }
.chip-offer-preparing .chip-dot { background-color: var(--stage-offer-preparing); }

.chip-offer-ready { background-color: var(--primary-light); color: var(--stage-offer-ready); }
.chip-offer-ready .chip-dot { background-color: var(--stage-offer-ready); }

.chip-presentation-planned { background-color: #e5dbff; color: var(--stage-presentation); }
.chip-presentation-planned .chip-dot { background-color: var(--stage-presentation); }

.chip-presented { background-color: var(--warning-light); color: var(--stage-presented); }
.chip-presented .chip-dot { background-color: var(--stage-presented); }

.chip-waiting-feedback { background-color: #ffe8cc; color: var(--stage-waiting); }
.chip-waiting-feedback .chip-dot { background-color: var(--stage-waiting); }

.chip-approved { background-color: var(--success-light); color: var(--stage-approved); }
.chip-approved .chip-dot { background-color: var(--stage-approved); }

.chip-rejected { background-color: var(--danger-light); color: var(--stage-rejected); }
.chip-rejected .chip-dot { background-color: var(--stage-rejected); }

.chip-on-hold { background-color: #e9ecef; color: var(--stage-hold); }
.chip-on-hold .chip-dot { background-color: var(--stage-hold); }

.chip-cancelled { background-color: #f1f3f5; color: var(--stage-cancelled); }
.chip-cancelled .chip-dot { background-color: var(--stage-cancelled); }

/* Generic Chips */
.chip-success { background-color: var(--success-light); color: var(--success); }
.chip-warning { background-color: var(--warning-light); color: var(--warning); }
.chip-danger { background-color: var(--danger-light); color: var(--danger); }
.chip-info { background-color: var(--info-light); color: var(--info); }
.chip-secondary { background-color: var(--bg-tertiary); color: var(--text-secondary); }
.chip-sm { padding: 2px 8px; font-size: 11px; }

/* === CARDS === */
.card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

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

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

.card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: var(--space-3);
}

.card-footer {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* KPI Card */
.kpi-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  transition: all 0.15s;
}

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

.kpi-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.kpi-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.kpi-trend {
  font-size: var(--text-xs);
  color: var(--success);
}

.kpi-trend.negative {
  color: var(--danger);
}

/* List Item Card */
.list-item {
  padding: var(--space-2);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color 0.15s;
}

.list-item:hover {
  background-color: var(--bg-hover);
}

.list-item.active {
  background-color: var(--primary-light);
  border-left: 3px solid var(--primary);
}

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

/* === TABLE === */
.table-container {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background-color: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.table th {
  padding: 12px var(--space-2);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
}

.table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-sm);
}

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

.table tbody tr:hover {
  background-color: var(--bg-hover);
}

/* === MOBILE PROJECT CARDS === */
.project-list-mobile {
  display: none;
}

.table-desktop-only {
  display: block;
}

.project-card-mobile {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s;
}

.project-card-mobile:hover {
  background-color: var(--bg-hover);
  color: inherit;
}

.interaction-list-mobile {
  display: none;
}

/* === FORMS === */
/* ============================================
   FORM STRUCTURE
   ============================================ */

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
  font-weight: 700;
  margin-left: 2px;
}

/* ============================================
   MODERN FORM INPUTS
   ============================================ */

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-clip: padding-box;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Hover state */
.form-input:hover:not(:disabled):not(:focus),
.form-select:hover:not(:disabled):not(:focus),
.form-textarea:hover:not(:disabled):not(:focus) {
  border-color: var(--border-medium);
  background-color: var(--bg-secondary);
}

/* Focus state */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--bg-primary);
  box-shadow: 0 0 0 4px var(--primary-light), 0 1px 2px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

/* Placeholder styling */
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
  font-weight: 400;
}

.form-input:focus::placeholder,
.form-textarea:focus::placeholder {
  opacity: 0.5;
}

/* Disabled state */
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background-color: var(--bg-tertiary);
  border-color: var(--border-light);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Select specific */
.form-select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.form-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234263eb' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

/* Textarea specific */
.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* Helper text */
.form-helper {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.form-helper svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* Input with icon */
.input-with-icon {
  position: relative;
}

.input-with-icon .form-input {
  padding-left: 44px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  pointer-events: none;
  opacity: 0.7;
}

/* Input group */
.input-group {
  display: flex;
  gap: 8px;
}

.input-group .form-input {
  flex: 1;
}

/* Success state */
.form-input.success,
.form-select.success,
.form-textarea.success {
  border-color: var(--success);
  background-color: var(--success-light);
}

.form-input.success:focus,
.form-select.success:focus,
.form-textarea.success:focus {
  box-shadow: 0 0 0 4px rgba(43, 138, 62, 0.1), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  font-size: var(--text-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

.search-input:focus {
  outline: none;
  background-color: var(--bg-primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* === KANBAN === */
.kanban-board {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.kanban-column {
  flex: 0 0 300px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-2);
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.kanban-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.kanban-count {
  background-color: var(--bg-primary);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kanban-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: 100px;
}

.kanban-item {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  cursor: move;
  transition: all 0.15s;
}

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

/* === DRAWER === */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 500px;
  height: 100vh;
  background-color: var(--bg-primary);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-drawer);
  transform: translateX(100%);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}

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

.drawer-header {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.drawer-body {
  flex: 1;
  padding: var(--space-3);
  overflow-y: auto;
}

.drawer-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-drawer) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

/* === MODAL === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.modal-body {
  padding: var(--space-3);
}

.modal-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

/* === TOAST === */
.toast-container {
  position: fixed;
  top: var(--space-3);
  right: var(--space-3);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.toast {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 300px;
  animation: slideIn 0.3s;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-left: 4px solid var(--success); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-danger { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--info); }

/* === TABS === */
.tabs {
  display: flex;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-3);
}

.tab {
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* === UTILITY CLASSES === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }

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

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.cursor-pointer { cursor: pointer; }

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

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .split-layout {
    grid-template-columns: 1fr;
  }

  .split-detail {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    height: 100vh;
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: var(--z-drawer);
  }

  .split-detail.open {
    transform: translateX(0);
  }

  .split-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: calc(var(--z-drawer) - 1);
  }

  .split-overlay.active {
    display: block;
  }

  .split-detail-close {
    display: flex;
  }

  /* Topbar Mobile Adjustments */
  .topbar-logo-text {
    display: inline;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .topbar-nav {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - var(--topbar-height));
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2);
    overflow-y: auto;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: calc(var(--z-topbar) - 1);
  }

  .topbar-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .topbar-nav-item {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
  }

  .topbar-nav-dropdown {
    width: 100%;
  }

  .topbar-nav-dropdown .topbar-nav-item {
    width: 100%;
  }

  .topbar-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    margin-top: var(--space-1);
    padding-left: var(--space-3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .topbar-nav-dropdown.open .topbar-dropdown-menu {
    max-height: 500px;
  }

  .topbar-nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
  }

  .topbar-dropdown-item {
    padding: 10px 16px;
  }

  .topbar-right {
    gap: var(--space-1);
  }

  .topbar-search {
    display: none;
  }

  .search-input {
    width: 200px;
  }

  .search-input:focus {
    width: 200px;
  }

  .btn-text {
    display: none;
  }

  .user-info {
    display: none;
  }

  .user-menu-button {
    padding: 6px;
    border: none;
  }
}

@media (max-width: 768px) {

  .kanban-board {
    flex-direction: column;
  }

  .kanban-column {
    flex: 1 1 auto;
  }
}

/* === EMPTY STATES === */
.empty-state {
  text-align: center;
  padding: var(--space-6);
  color: var(--text-muted);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-2);
  opacity: 0.3;
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.empty-state-text {
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  background-color: var(--danger);
  color: var(--text-inverse);
  border-radius: var(--radius-full);
}

.badge-primary { background-color: var(--primary); }
.badge-success { background-color: var(--success); }
.badge-warning { background-color: var(--warning); }
.badge-danger { background-color: var(--danger); }

/* === TABS === */
.tabs-container {
  display: flex;
  gap: var(--space-1);
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--space-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-button {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-button:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

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

.tab-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.tab-button.active .tab-count {
  color: var(--primary);
  font-weight: 600;
}

/* === TASK COMPLETED STYLES === */
.task-completed {
  opacity: 0.6;
  background-color: var(--bg-secondary);
}

.task-completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-completed .task-desc {
  color: var(--text-muted);
}

.task-row {
  transition: all 0.2s;
}

.task-row:hover {
  background-color: var(--bg-hover);
}


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

/* Tablet - 768px and below */
@media (max-width: 768px) {
  :root {
    --topbar-height: 56px;
  }

  /* Reduce padding on mobile */
  .app-content {
    padding: var(--space-2);
  }

  .app-topbar {
    padding: 0 var(--space-2);
  }

  /* Grid adjustments */
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }

  .grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Card adjustments */
  .card {
    border-radius: var(--radius-md);
  }

  /* Table container - enable horizontal scroll */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 600px;
  }

  /* Split layout becomes single column */
  .split-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  /* KPI cards stack */
  .kpi-card {
    min-height: 100px;
  }

  /* Form adjustments */
  .form-group.col-span-2 {
    grid-column: span 1;
  }

  /* Smaller text on mobile */
  .h1 {
    font-size: 24px;
  }

  .h2 {
    font-size: 20px;
  }

  .card-title {
    font-size: 16px;
  }

  /* Button groups stack */
  .flex.gap-2 {
    flex-wrap: wrap;
  }

  /* Kanban becomes vertical scroll */
  .kanban-board {
    flex-direction: column;
    overflow-x: visible;
  }

  .kanban-column {
    min-width: 100%;
    max-width: 100%;
  }

  /* Tab responsive */
  .tabs-container {
    gap: 4px;
    padding-bottom: 2px;
  }

  .tab-button {
    padding: 10px 16px;
    font-size: 13px;
  }

  .tab-count {
    display: block;
    margin-top: 2px;
  }

  /* Task table on mobile */
  .task-row td {
    font-size: 13px;
    padding: var(--space-1);
  }

  .task-title {
    font-size: 14px;
  }

  .task-desc {
    font-size: 11px;
  }
}

/* Small Mobile - 480px and below */
@media (max-width: 480px) {
  :root {
    --topbar-height: 52px;
  }

  /* All grids become single column */
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }

  /* Reduce spacing further */
  .app-content {
    padding: var(--space-1);
  }

  /* Compact cards */
  .card-body {
    padding: var(--space-2);
  }

  .card-header {
    padding: var(--space-2);
  }

  /* Smaller buttons */
  .btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Hide some secondary info on very small screens */
  .text-muted.hidden-xs {
    display: none;
  }

  /* Compact list items */
  .list-item {
    padding: var(--space-2);
  }

  /* Smaller KPI values */
  .kpi-value {
    font-size: 28px;
  }

  /* Topbar search becomes full width */
  .search-input {
    max-width: 100%;
  }
}

/* Large Desktop - 1440px and above */
@media (min-width: 1440px) {
  .app-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-4);
  }

  .topbar-logo-text {
    display: inline;
  }
}

/* Print styles */
@media print {
  .app-topbar,
  .btn {
    display: none !important;
  }

  .app-content {
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}

/* === INFO CARDS === */
.info-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

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

.info-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.info-card-content {
  flex: 1;
}

.info-card-title {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.info-card-value {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
}

/* === FORM ERROR STYLING === */
.form-error {
  color: var(--danger);
  font-size: var(--text-xs);
  margin-top: 4px;
  display: block;
}

/* Error state */
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  background-color: var(--danger-light);
  animation: shake 0.3s ease;
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 4px rgba(224, 49, 49, 0.15), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Form error message */
.form-error {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--danger);
  background-color: var(--danger-light);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  animation: slideInDown 0.2s ease;
}

.form-error::before {
  content: "⚠";
  font-size: 14px;
}

/* Shake animation for errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

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

/* === TOAST NOTIFICATIONS === */
.toast {
  position: fixed;
  top: 80px;
  right: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-primary);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  animation: slideInRight 0.3s;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 300px;
  max-width: 500px;
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-success {
  border-left-color: var(--success);
}

.toast svg {
  flex-shrink: 0;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* === CONTACT CARDS === */
.contact-card {
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

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

.contact-card-name {
  font-weight: 600;
  font-size: var(--text-base);
  margin-bottom: 4px;
}

.contact-card-title {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.contact-card-info {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* === STATS CARD === */
.stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-light);
}

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

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary);
}

/* === ACTION BUTTONS === */
.action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: var(--space-2);
}

.action-btn:hover {
  background: var(--bg-hover);
  transform: translateX(2px);
}

.action-btn:last-child {
  margin-bottom: 0;
}

.action-btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.action-btn-content {
  flex: 1;
}

.action-btn-title {
  font-weight: 500;
  font-size: var(--text-sm);
  margin-bottom: 2px;
}

.action-btn-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* === BREADCRUMB === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

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

.breadcrumb-separator {
  color: var(--text-muted);
}

/* === QUICK INFO BAR === */
.quick-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

.quick-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-info-item a {
  color: var(--primary);
  text-decoration: none;
}

.quick-info-item a:hover {
  text-decoration: underline;
}

/* User Menu Dropdown */
.user-menu-wrapper {
  position: relative;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 250px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}

.user-menu-dropdown.show {
  display: block;
}

.user-menu-header {
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.user-name-full {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.user-email-full {
  font-size: 0.8125rem;
  opacity: 0.9;
}

.user-menu-divider {
  height: 1px;
  background: var(--border-light);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s;
}

.user-menu-item:hover {
  background: var(--bg-secondary);
}

.user-menu-item .nav-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

/* User Dropdown Menu */
.user-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 200px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.user-menu-wrapper.open .user-dropdown-menu {
  display: block;
  animation: slideDown 0.2s ease-out;
}

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

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s;
  font-size: var(--text-sm);
}

.user-dropdown-item:hover {
  background: var(--bg-secondary);
}

.user-dropdown-item svg {
  flex-shrink: 0;
}

/* ════════════════════════════════════════
   MODERN PROJECT CARDS
   ════════════════════════════════════════ */
.project-card-modern {
  display: block;
  padding: var(--space-3);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.project-card-modern:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(66, 99, 235, 0.1);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.project-card-title-section {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.project-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.project-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.project-meta-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.project-card-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-light);
}

/* ════════════════════════════════════════
   MODERN CONTACT CARDS
   ════════════════════════════════════════ */
.contact-card-modern {
  display: block;
  padding: var(--space-3);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.contact-card-modern:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(66, 99, 235, 0.1);
  transform: translateY(-2px);
}

.contact-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  position: relative;
}

.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

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

.contact-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-title {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.decision-maker-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b8860b;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.decision-maker-badge svg {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.contact-detail-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.contact-detail-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-status-badge {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-light);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .project-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .project-card-value {
    align-self: flex-start;
  }
  
  .contact-card-modern {
    grid-column: span 2;
  }
}

/* ════════════════════════════════════════
   COMPACT CARDS (for split view)
   ════════════════════════════════════════ */

/* Compact Contact Cards */
.contact-card-compact {
  display: block;
  padding: var(--space-2);
  background: var(--bg-secondary);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.contact-card-compact:hover {
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.contact-card-header-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  position: relative;
}

.contact-avatar-compact {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

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

.contact-name-compact {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-title-compact {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.decision-maker-badge-compact {
  position: absolute;
  top: -4px;
  right: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b8860b;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.contact-details-compact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 42px;
}

.contact-detail-item-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.contact-detail-item-compact svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.contact-detail-item-compact span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact Project Cards */
.project-card-compact {
  display: block;
  padding: var(--space-2);
  background: var(--bg-secondary);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.project-card-compact:hover {
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.project-card-header-compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 8px;
}

.project-card-title-section-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.project-card-title-compact {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-value-compact {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.project-card-meta-compact {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.project-meta-item-compact {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.project-meta-item-compact svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ============================================
   MODERN TOGGLE SWITCH
   ============================================ */

.toggle-switch-wrapper {
  display: inline-block;
  position: relative;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle-switch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-medium);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Hover effect */
.toggle-switch:hover .toggle-slider {
  background-color: var(--border-dark);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  box-shadow: 0 2px 8px rgba(66, 99, 235, 0.3);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:focus + .toggle-slider {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* Disabled state */
.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toggle option card */
.toggle-option-card {
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 16px;
}

.toggle-option-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
}

.toggle-option-card.active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.toggle-option-content {
  flex: 1;
}

.toggle-option-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-option-description {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Badge style for special options */
.toggle-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--warning-light);
  color: var(--warning);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.toggle-badge.decision-maker {
  background: linear-gradient(135deg, #fff3bf 0%, #ffe066 100%);
  color: #f08c00;
}

.toggle-badge.active {
  background: var(--success-light);
  color: var(--success);
}

/* ============================================
   ENHANCED MOBILE RESPONSIVE STYLES
   ============================================ */

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

/* Responsive Display Helpers */
.hidden-mobile {
  display: block;
}

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

.show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .show-mobile {
    display: block !important;
  }
}

.show-mobile-flex {
  display: none;
}

@media (max-width: 768px) {
  .show-mobile-flex {
    display: flex !important;
  }
}

/* Text Overflow Helper */
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile-First Flexbox Classes */
.flex-mobile-column {
  display: flex;
}

@media (max-width: 768px) {
  .flex-mobile-column {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

.flex-mobile-wrap {
  display: flex;
}

@media (max-width: 768px) {
  .flex-mobile-wrap {
    flex-wrap: wrap !important;
  }
}

/* === ENHANCED RESPONSIVE BREAKPOINTS === */

/* Extra Small Mobile - 375px and below (iPhone SE, older phones) */
@media (max-width: 375px) {
  :root {
    --topbar-height: 52px;
    --space-1: 6px;
    --space-2: 12px;
    --space-3: 18px;
  }

  .app-content {
    padding: var(--space-1) !important;
  }

  .app-topbar {
    padding: 0 var(--space-1) !important;
  }

  /* Notification btn gizle — sadece hamburger + quick-add + user kalır */
  .topbar-actions .btn[title="Bildirimler"] {
    display: none;
  }

  .h1 {
    font-size: 18px !important;
    line-height: 1.3;
  }

  .h2 {
    font-size: 16px !important;
  }

  .btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Hide button text on very small screens */
  .btn-sm span:not(.chip):not(.badge) {
    display: none;
  }

  .card-body {
    padding: var(--space-2);
  }
}

/* Small Mobile - 480px and below */
@media (max-width: 480px) {
  /* Topbar logo text gizle */
  .topbar-logo-text {
    display: none !important;
  }

  /* Page Headers */
  .h1 {
    font-size: 20px;
    line-height: 1.3;
  }

  .h2 {
    font-size: 18px;
  }

  .h3 {
    font-size: 16px;
  }

  /* Button text hiding for small screens */
  .btn.btn-sm svg + span {
    display: none;
  }

  .btn.btn-sm {
    padding: 8px;
    min-width: 36px;
    justify-content: center;
  }

  /* Icon-only mode for action buttons */
  .topbar-actions .btn span:not(.badge) {
    display: none;
  }

  /* Compact cards */
  .card {
    border-radius: var(--radius-md);
  }

  .card-body {
    padding: var(--space-2);
  }

  .card-header {
    padding: var(--space-2);
    flex-direction: column;
    align-items: flex-start !important;
    gap: var(--space-1);
  }

  .card-title {
    font-size: 16px;
  }

  /* Grid spacing reduction */
  .grid {
    gap: var(--space-1) !important;
  }

  /* List items more compact */
  .list-item {
    padding: var(--space-2);
  }

  /* Smaller KPI values */
  .kpi-value {
    font-size: 28px;
  }

  .kpi-label {
    font-size: 12px;
  }
}

/* Tablet and Large Mobile - 768px and below */
@media (max-width: 768px) {
  /* === PAGE HEADER RESPONSIVE === */
  
  /* Main page header wrapper */
  .app-content > div > .flex.items-center.justify-between.mb-3,
  .app-content > .flex.items-center.justify-between.mb-3 {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--space-2);
  }

  /* Header title section */
  .app-content > div > .flex.items-center.justify-between.mb-3 > div:first-child,
  .app-content > .flex.items-center.justify-between.mb-3 > div:first-child {
    width: 100%;
  }

  /* Header button groups */
  .app-content > div > .flex.items-center.justify-between.mb-3 > .flex.gap-2,
  .app-content > .flex.items-center.justify-between.mb-3 > .flex.gap-2,
  .app-content > div > .flex.items-center.justify-between.mb-3 > .flex.items-center.gap-2,
  .app-content > .flex.items-center.justify-between.mb-3 > .flex.items-center.gap-2 {
    width: 100%;
    flex-wrap: wrap;
    gap: var(--space-1) !important;
  }

  /* Button groups - ensure proper sizing */
  .flex.gap-2 > .btn,
  .flex.items-center.gap-2 > .btn {
    flex: 1;
    min-width: fit-content;
  }

  /* Single buttons take less space */
  .flex.gap-2 > .btn:only-child,
  .flex.items-center.gap-2 > .btn:only-child {
    flex: 0 1 auto;
    margin-left: auto;
  }

  /* === ENHANCED TOPBAR === */
  .app-topbar {
    padding: 0 var(--space-2);
    gap: var(--space-1);
  }

  .topbar-logo-text {
    font-size: 15px;
  }

  .topbar-admin-link {
    display: none;
  }

  /* === GRID SYSTEM ENHANCEMENTS === */
  
  /* 12-column grid to full width */
  .grid-cols-12 > * {
    grid-column: span 12 !important;
  }

  /* 2-column to single */
  .grid.grid-cols-2,
  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* 3-column to single */
  .grid.grid-cols-3,
  .grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* Gap adjustments */
  .grid.gap-3 {
    gap: var(--space-2);
  }

  .grid.gap-4 {
    gap: var(--space-2);
  }

  /* === SPLIT LAYOUT ENHANCEMENTS === */
  .split-detail {
    width: 100% !important;
    max-width: 100vw;
  }

  .split-detail-close {
    display: flex !important;
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 10;
  }

  /* === BREADCRUMB === */
  .breadcrumb {
    font-size: 13px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* === QUICK INFO === */
  .quick-info {
    flex-wrap: wrap;
    gap: var(--space-1);
  }

  .quick-info-item {
    font-size: 13px;
  }

  /* === CHIPS & FILTERS === */
  
  /* Filter chips horizontal scroll */
  .flex.gap-1[style*="flex-wrap"] {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .chip {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* === CONTACT CARDS === */
  .contacts-grid {
    grid-template-columns: 1fr !important;
  }

  .contact-card {
    max-width: 100%;
  }

  /* === INFO CARDS === */
  .info-card {
    padding: var(--space-2);
  }

  .info-card-icon {
    width: 36px;
    height: 36px;
  }

  .info-card-icon svg {
    width: 18px;
    height: 18px;
  }

  /* === TABS === */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 13px;
  }

  /* === PROJECT CARDS === */
  .project-card {
    padding: var(--space-2);
  }

  .project-card-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: var(--space-1);
  }

  /* === ACTIVITY TIMELINE === */
  .activity-timeline {
    padding-left: var(--space-2);
  }

  .activity-item {
    padding-left: var(--space-3);
  }

  /* === FORM ENHANCEMENTS === */
  
  /* Form grids to single column */
  .form-grid,
  form .grid {
    grid-template-columns: 1fr !important;
  }

  .form-group.col-span-2 {
    grid-column: span 1 !important;
  }

  /* Form inputs full width */
  .form-input,
  .form-select,
  .form-textarea {
    width: 100%;
  }

  /* === TABLE RESPONSIVE === */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(-1 * var(--space-2));
    padding: 0 var(--space-2);
  }

  .table {
    min-width: 600px;
  }

  .table td,
  .table th {
    padding: var(--space-1) var(--space-1);
    font-size: 13px;
  }

  /* Mobile kart listesi göster, desktop tablo gizle */
  .project-list-mobile,
  .interaction-list-mobile {
    display: block;
  }

  .table-desktop-only {
    display: none;
  }

  /* === KPI CARDS === */
  .kpi-card {
    min-height: 100px;
    padding: var(--space-2);
  }

  .kpi-value {
    font-size: 32px;
  }

  .kpi-label {
    font-size: 13px;
  }

  .kpi-trend {
    font-size: 12px;
  }

  /* === BUTTON GROUPS === */
  .btn-group {
    display: flex;
    flex-wrap: nowrap;
  }

  .btn-group .btn {
    flex: 1;
    min-width: 0;
  }

  /* === MODAL/DRAWER === */
  .modal-content {
    width: calc(100% - var(--space-4));
    max-height: calc(100vh - var(--space-4));
    margin: var(--space-2);
  }

  /* === USER MENU === */
  .user-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 200px;
  }

  /* === SEARCH === */
  .search-input {
    width: 100%;
  }

  /* === PAGINATION === */
  .pagination {
    font-size: 13px;
    gap: 4px;
  }

  .pagination .btn {
    padding: 6px 10px;
    font-size: 13px;
  }

  /* === TOAST NOTIFICATIONS === */
  .toast-container {
    left: var(--space-2);
    right: var(--space-2);
    bottom: var(--space-2);
  }

  .toast {
    width: 100%;
  }

  /* === EMPTY STATES === */
  .empty-state {
    padding: var(--space-4);
  }

  .empty-state-icon {
    width: 48px;
    height: 48px;
  }

  /* === BADGES IN LISTS === */
  .list-item .badge,
  .list-item .chip {
    font-size: 11px;
    padding: 2px 6px;
  }

  /* === CALENDAR === */
  .calendar-grid {
    font-size: 13px;
  }

  .calendar-day {
    min-height: 80px;
    padding: 4px;
  }

  /* === STAT CARDS === */
  .stat-card {
    padding: var(--space-2);
  }

  .stat-value {
    font-size: 24px;
  }

  /* === PROFILE SECTIONS === */
  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-avatar {
    width: 80px;
    height: 80px;
  }

  /* === FILTER PANELS === */
  .filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-drawer);
    background: var(--bg-primary);
    transform: translateY(100%);
    transition: transform 0.3s;
  }

  .filter-panel.active {
    transform: translateY(0);
  }
}

/* Small Desktop / Large Tablet - 1024px and below */
@media (max-width: 1024px) {
  /* Additional adjustments for the transition zone */
  
  .topbar-actions {
    gap: var(--space-1);
  }

  .topbar-search {
    width: auto;
  }

  .search-input {
    width: 180px;
  }

  .search-input:focus {
    width: 220px;
  }

  /* Sidebar if exists */
  .sidebar {
    width: 240px;
  }
}

/* Large Screens - 1440px and above */
@media (min-width: 1440px) {
  /* Better spacing on large screens */
  .container-xl {
    max-width: 1400px;
    margin: 0 auto;
  }

  /* Larger split panels */
  .split-list {
    max-width: 420px;
  }

  .split-detail {
    padding: var(--space-4);
  }
}

/* === PRINT ENHANCEMENTS === */
@media print {
  /* Hide interactive elements */
  .btn,
  .topbar-nav,
  .mobile-menu-toggle,
  .topbar-actions,
  .topbar-search,
  .split-overlay,
  .toast-container {
    display: none !important;
  }

  /* Optimize for printing */
  .app-content {
    padding: 0;
    max-width: 100%;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  /* Expand all collapsed sections */
  .tab-content {
    display: block !important;
  }

  /* Single column for print */
  .grid {
    grid-template-columns: 1fr !important;
  }
}
