/* ============================================
   Collab Pharmacy SaaS - Design System CSS
   Version: POC 1.0
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors - Primary */
  --primary: #0F766E;
  --primary-light: #CCFBF1;
  --primary-dark: #115E59;
  --primary-50: #F0FDFA;

  /* Colors - Accent */
  --accent: #F59E0B;
  --accent-light: #FEF3C7;

  /* Colors - Surfaces */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-hover: #F1F5F9;
  --border: #E2E8F0;
  --border-light: #F1F5F9;

  /* Colors - Text */
  --text: #1E293B;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  /* Colors - Semantic */
  --success: #22C55E;
  --success-bg: #F0FDF4;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --info: #3B82F6;
  --info-bg: #EFF6FF;

  /* Typography */
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

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

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.08), 0 4px 6px rgba(15, 23, 42, 0.04);

  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-normal: 250ms ease-out;
}

/* ---------- 1. Reset + Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
}

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

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

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

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
}

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

.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo img,
.sidebar-logo svg {
  width: 32px;
  height: 32px;
}

.nav-section {
  padding: var(--space-4) var(--space-3);
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 var(--space-2);
  margin-bottom: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

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

.nav-item.active {
  background: var(--primary-50);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  margin-left: 240px;
  padding: var(--space-6) var(--space-8);
  min-width: 0;
}

/* ---------- 3. Top Bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.greeting {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.greeting-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ---------- 4. Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

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

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

/* ---------- 5. Stat Cards ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-trend {
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

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

.stat-trend.down {
  color: var(--error);
}

/* ---------- 6. Tables ---------- */
.table-wrapper {
  overflow-x: auto;
}

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

.table th {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  font-size: 14px;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  height: 48px;
  vertical-align: middle;
}

.table tr:hover td {
  background: var(--primary-50);
}

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

/* ---------- 7. Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

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

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

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

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

.badge-neutral {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

/* ---------- 8. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

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

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

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

.btn-danger {
  background: var(--error);
  color: var(--surface);
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-sm {
  height: 32px;
  padding: 0 var(--space-3);
  font-size: 13px;
}

/* ---------- 9. Forms ---------- */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea {
  height: auto;
  min-height: 80px;
  padding: var(--space-3);
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-error {
  font-size: 12px;
  color: var(--error);
  margin-top: var(--space-1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
}

/* ---------- 10. Kanban ---------- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  min-height: 400px;
}

.kanban-column {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  min-height: 200px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--border);
}

.kanban-column-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.kanban-column-header .count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}

.kanban-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-xs);
  cursor: grab;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

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

.kanban-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- 11. Chat / Messages ---------- */
.message-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.message-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.message-item:hover {
  background: var(--surface-hover);
}

.message-bubble {
  flex: 1;
}

.message-sender {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.message-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: var(--space-1);
}

.message-urgent {
  border-left: 3px solid var(--error);
  padding-left: var(--space-3);
}

/* ---------- 12. Calendar ---------- */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.calendar-nav-tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--bg);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
}

.calendar-nav-tab {
  padding: var(--space-2) var(--space-4);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-nav-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendar-day {
  background: var(--surface);
  min-height: 100px;
  padding: var(--space-2);
}

.calendar-day-number {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.calendar-day.today {
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
}

.calendar-day.today .calendar-day-number {
  color: var(--primary);
  font-weight: 700;
}

.calendar-day.other-month {
  opacity: 0.4;
}

.calendar-event {
  font-size: 11px;
  font-weight: 500;
  padding: 2px var(--space-2);
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.calendar-event.event-accent {
  background: var(--accent-light);
  color: #92400E;
}

.calendar-event.event-error {
  background: var(--error-bg);
  color: var(--error);
}

/* ---------- 13. Modal ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

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

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

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

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

/* ---------- 14. Toast ---------- */
.toast-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  width: 360px;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: toast-slide-in 300ms ease-out;
}

.toast.toast-exit {
  animation: toast-slide-out 200ms ease-in forwards;
}

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

.toast-error {
  border-left: 4px solid var(--error);
}

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

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

.toast-message {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.toast-title {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.toast-description {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ---------- 15. Progress Bar ---------- */
.progress-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 500ms ease-out;
}

.progress-fill.accent {
  background: var(--accent);
}

/* ---------- 16. Activity Feed ---------- */
.activity-feed {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.dot-success {
  background: var(--success);
}

.activity-dot.dot-warning {
  background: var(--warning);
}

.activity-dot.dot-error {
  background: var(--error);
}

.activity-text {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}

.activity-text strong {
  color: var(--text);
  font-weight: 600;
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- 17. Quick Actions ---------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.quick-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-light);
  color: var(--primary);
}

.quick-btn .quick-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* ---------- 18. Challenge Card ---------- */
.challenge-card {
  background: var(--accent-light);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

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

.challenge-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.challenge-info {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- 19. Schedule Editor ---------- */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
}

.schedule-day-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-2) 0;
  text-transform: uppercase;
}

.schedule-slot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  min-height: 60px;
  transition: border-color var(--transition-fast);
}

.schedule-slot:hover {
  border-color: var(--primary);
}

.schedule-slot.filled {
  background: var(--primary-50);
  border-color: var(--primary-light);
}

.time-input {
  width: 100%;
  height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  text-align: center;
}

.time-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

/* ---------- 20. Tabs ---------- */
.tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--bg);
  border-radius: var(--radius-sm);
  width: fit-content;
}

.tab {
  padding: var(--space-2) var(--space-4);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

/* ---------- 21. Empty States ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 320px;
  margin-bottom: var(--space-5);
}

/* ---------- 22. User Card ---------- */
.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

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

.user-avatar.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.user-avatar.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.user-role {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- 23. Mobile Nav ---------- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 50;
  align-items: center;
  justify-content: space-around;
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  transition: color var(--transition-fast);
  text-decoration: none;
}

.mobile-tab .mobile-tab-icon {
  width: 24px;
  height: 24px;
}

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

/* ---------- More Menu (mobile popup) ---------- */
.more-menu {
  position: fixed;
  bottom: 72px;
  right: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: 60;
  min-width: 200px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.more-menu.visible {
  opacity: 1;
  transform: translateY(0);
}

.more-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

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

/* ---------- 24. Responsive ---------- */
@media (max-width: 1024px) {
  .sidebar {
    width: 64px;
    min-width: 64px;
  }

  .sidebar .nav-item span,
  .sidebar .nav-label,
  .sidebar-logo span {
    display: none;
  }

  .sidebar .nav-item {
    justify-content: center;
    padding: 0;
    border-left: none;
  }

  .sidebar .nav-item.active {
    border-left: none;
    border-bottom: 2px solid var(--primary);
  }

  .sidebar-logo {
    justify-content: center;
    padding: var(--space-4);
  }

  .main-content {
    margin-left: 64px;
    padding: var(--space-5);
  }

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

  .kanban-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: var(--space-4);
    padding-bottom: 80px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

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

  .greeting {
    font-size: 20px;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }

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

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .calendar-day {
    min-height: 60px;
    padding: var(--space-1);
  }

  .calendar-event {
    font-size: 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    top: var(--space-4);
  }

  .toast {
    width: 100%;
  }

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

@media (max-width: 375px) {
  .main-content {
    padding: var(--space-3);
    padding-bottom: 80px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

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

  .stat-number {
    font-size: 20px;
  }

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

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

  .greeting {
    font-size: 18px;
  }

  .btn {
    height: 36px;
    font-size: 13px;
  }
}

/* ---------- 25. Landing Page ---------- */
.landing {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--surface);
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-8);
  max-width: 1200px;
  margin: 0 auto;
}

.landing-header .logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.landing-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

/* Hero Section */
.hero-section {
  position: relative;
  width: 100%;
  padding: var(--space-16) var(--space-8);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #0D5C55 100%);
  color: var(--surface);
  text-align: center;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 40%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.hero-section h1 {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-5);
  letter-spacing: -0.02em;
}

.hero-section p {
  font-size: 18px;
  line-height: 1.6;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

/* CTA Button */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 52px;
  padding: 0 var(--space-8);
  background: var(--accent);
  color: #1E293B;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.cta-button:hover {
  background: #E8930A;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.cta-button-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 52px;
  padding: 0 var(--space-8);
  background: transparent;
  color: var(--surface);
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cta-button-outline:hover {
  border-color: var(--surface);
  background: rgba(255, 255, 255, 0.1);
}

/* App Preview */
.app-preview {
  max-width: 1000px;
  margin: calc(-1 * var(--space-16)) auto var(--space-16);
  padding: 0 var(--space-8);
  position: relative;
  z-index: 5;
}

.app-preview-frame {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 25px 50px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  border: 1px solid var(--border);
}

.app-preview-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.app-preview-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--border);
}

.app-preview-dot:nth-child(1) {
  background: #EF4444;
}

.app-preview-dot:nth-child(2) {
  background: #F59E0B;
}

.app-preview-dot:nth-child(3) {
  background: #22C55E;
}

.app-preview-body {
  padding: var(--space-6);
  min-height: 300px;
}

/* Section Titles */
.section-title {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-12);
  line-height: 1.6;
}

/* Landing Sections */
.landing-section {
  padding: var(--space-16) var(--space-8);
  max-width: 1200px;
  margin: 0 auto;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  transition: all var(--transition-normal);
}

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

.feature-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-50);
  border-radius: var(--radius-md);
  color: var(--primary);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* How It Works */
.how-it-works {
  padding: var(--space-16) var(--space-8);
  background: var(--bg);
}

.how-it-works-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  counter-reset: steps;
}

.step-item {
  text-align: center;
  counter-increment: steps;
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--surface);
  font-size: 20px;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.step-item h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.step-item p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Landing Footer */
.landing-footer {
  padding: var(--space-10) var(--space-8);
  text-align: center;
  border-top: 1px solid var(--border);
}

.landing-footer p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Landing Responsive */
@media (max-width: 768px) {
  .hero-section {
    padding: var(--space-10) var(--space-4);
  }

  .hero-section h1 {
    font-size: 32px;
  }

  .hero-section p {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .cta-button,
  .cta-button-outline {
    width: 100%;
    max-width: 300px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .section-title {
    font-size: 28px;
  }

  .landing-header {
    padding: var(--space-4);
  }

  .landing-nav {
    display: none;
  }

  .app-preview {
    padding: 0 var(--space-4);
    margin-top: calc(-1 * var(--space-10));
  }
}

/* ---------- 26. Utility Classes ---------- */
.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

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

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

.gap-3 {
  gap: var(--space-3);
}

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

.mt-2 {
  margin-top: var(--space-2);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

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

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

.text-sm {
  font-size: 13px;
}

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

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Keyframes (Toast) ---------- */
@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
