/* ============================================================
   360 DEGREE M - AGENCY COMMAND CENTER
   Premium SaaS Dashboard Design System
   ============================================================ */

/* CSS Variables - Light Mode (Default) */
:root {
  /* Brand Colors */
  --primary: #2563EB;
  --primary-light: #DBEAFE;
  --primary-dark: #1D4ED8;
  --primary-50: #EFF6FF;
  --primary-100: #DBEAFE;
  --primary-600: #2563EB;
  --primary-700: #1D4ED8;

  /* Semantic Colors */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #06B6D4;
  --info-light: #CFFAFE;
  --purple: #8B5CF6;
  --purple-light: #EDE9FE;
  --orange: #F97316;
  --orange-light: #FFEDD5;
  --pink: #EC4899;
  --pink-light: #FCE7F3;

  /* Neutral Colors */
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-hover: #F1F5F9;
  --bg-active: #E2E8F0;

  /* Text Colors */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --text-muted: #CBD5E1;

  /* Border */
  --border: #E2E8F0;
  --border-light: #F1F5F9;

  /* Shadow */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.06), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.06), 0 8px 10px -6px rgb(0 0 0 / 0.04);

  /* Sidebar */
  --sidebar-width: 264px;
  --sidebar-bg: #FFFFFF;
  --sidebar-border: #E2E8F0;

  /* Header */
  --header-height: 64px;

  /* 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;

  /* Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

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

  /* Transitions */
  --transition: 150ms ease;
  --transition-slow: 250ms ease;

  /* Z-Index */
  --z-toast: 9999;
  --z-modal: 9990;
  --z-drawer: 9980;
  --z-sidebar: 100;
  --z-header: 50;
  --z-overlay: 40;

  /* Kanban status row backgrounds - light */
  --kanban-ns-bg: #F8FAFC;
  --kanban-ip-bg: #EFF6FF;
  --kanban-rp-bg: #FFFBEB;
  --kanban-cr-bg: #FEF2F2;
  --kanban-done-bg: #F0FDF4;
  --kanban-posted-bg: #F0FDFA;
}

/* Dark Mode */
[data-theme="dark"] {
  --primary: #3B82F6;
  --primary-light: #1E3A5F;
  --primary-dark: #60A5FA;
  --primary-50: #0F172A;
  --primary-100: #1E293B;

  --bg: #0A0A0A;
  --bg-card: #111111;
  --bg-elevated: #1A1A1A;
  --bg-hover: #1A1A1A;
  --bg-active: #262626;

  --text-primary: #FAFAFA;
  --text-secondary: #A3A3A3;
  --text-tertiary: #737373;
  --text-muted: #525252;

  --border: #262626;
  --border-light: #1A1A1A;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.2);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.2);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.2);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.4);

  --sidebar-bg: #111111;
  --sidebar-border: #262626;

  /* Kanban status row backgrounds - dark */
  --kanban-ns-bg: #18181B;
  --kanban-ip-bg: #172554;
  --kanban-rp-bg: #451A03;
  --kanban-cr-bg: #450A0A;
  --kanban-done-bg: #052E16;
  --kanban-posted-bg: #083344;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

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

/* App Layout */
#app {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-slow);
}

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

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

.logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.sidebar-close {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-tertiary);
}

.sidebar-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

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

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-full);
}

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

.nav-label {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

.nav-link svg {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: color var(--transition);
}

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

.nav-link:hover svg {
  color: var(--text-primary);
}

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

.nav-link.active svg {
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.sidebar-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--sidebar-border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--bg-hover);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  overflow: hidden;
}

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

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

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: var(--z-overlay);
  display: none;
}

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

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .header {
  background-color: rgba(17, 17, 17, 0.85);
}

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

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

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

.header-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  width: 320px;
  transition: all var(--transition);
}

.header-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.header-search svg {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.header-search input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: var(--text-primary);
}

.header-search input::placeholder {
  color: var(--text-tertiary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Role Switcher */
.role-switcher {
  margin-right: var(--space-2);
}

.role-select {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

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

/* Notification Button */
.notification-btn .notif-count {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* Profile */
.profile-dropdown {
  position: relative;
}

.profile-trigger {
  padding: 2px;
  border-radius: var(--radius-full);
  transition: box-shadow var(--transition);
}

.profile-trigger:hover {
  box-shadow: 0 0 0 2px var(--primary-100);
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  overflow: hidden;
  animation: fadeInDown 150ms ease;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-hover);
}

.profile-menu-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.profile-menu-role {
  font-size: 12px;
  color: var(--text-tertiary);
}

.profile-divider {
  height: 1px;
  background: var(--border);
  margin: 0 var(--space-3);
}

.profile-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

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

.profile-item svg {
  color: var(--text-tertiary);
}

/* ============================================================
   NOTIFICATION DRAWER
   ============================================================ */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-card);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: slideInRight 250ms ease;
}

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

.drawer-header h3 {
  font-size: 16px;
  font-weight: 700;
}

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

.drawer-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-tertiary);
}

.drawer-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.drawer-tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.drawer-tab {
  padding: var(--space-1) var(--space-3);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  transition: all var(--transition);
}

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

.drawer-tab.active {
  background: var(--primary-50);
  color: var(--primary);
}

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

.notif-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
}

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

.notif-item.unread {
  background: var(--primary-50);
}

.notif-item.unread:hover {
  background: var(--primary-100);
}

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

.notif-icon svg {
  width: 16px;
  height: 16px;
}

.notif-icon.work { background: var(--primary-light); color: var(--primary); }
.notif-icon.payment { background: var(--success-light); color: var(--success); }
.notif-icon.meeting { background: var(--purple-light); color: var(--purple); }
.notif-icon.client { background: var(--warning-light); color: var(--warning); }
.notif-icon.system { background: var(--info-light); color: var(--info); }

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

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notif-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 4px;
}

.notif-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

.notif-priority {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.notif-priority.high { background: var(--danger-light); color: var(--danger); }
.notif-priority.medium { background: var(--warning-light); color: var(--warning); }
.notif-priority.low { background: var(--info-light); color: var(--info); }

.drawer-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: calc(var(--z-drawer) - 1);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  padding: var(--space-6);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  min-height: 200px;
}

/* ============================================================
   INSTALL BANNER
   ============================================================ */
.install-banner {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 200;
  background: var(--primary);
  padding: var(--space-3) var(--space-5);
}

.install-banner-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 600px;
}

.install-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.install-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: white;
}

.install-text strong {
  font-size: 13px;
}

.install-text span {
  font-size: 12px;
  opacity: 0.9;
}

.install-dismiss {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  opacity: 0.7;
}

.install-dismiss:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

/* ============================================================
   BOTTOM NAV (Mobile)
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: var(--z-header);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2);
  font-size: 10px;
  color: var(--text-tertiary);
  transition: color var(--transition);
}

.bottom-nav-link svg {
  color: var(--text-tertiary);
}

.bottom-nav-link.active,
.bottom-nav-link.active svg {
  color: var(--primary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

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

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

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

.btn-secondary:hover {
  background: var(--bg-hover);
}

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

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

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

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

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

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: 12px;
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: var(--space-2);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

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

.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-header h2, .card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

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

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

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

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

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
}

.kpi-change {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.kpi-change.positive {
  color: var(--success);
  background: var(--success-light);
}

.kpi-change.negative {
  color: var(--danger);
  background: var(--danger-light);
}

.kpi-subtext {
  color: var(--text-tertiary);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

.badge-planned { background: var(--border-light); color: var(--text-tertiary); }
.badge-inprogress { background: var(--primary-light); color: var(--primary); }
.badge-draftready { background: var(--purple-light); color: var(--purple); }
.badge-sentforapproval { background: var(--warning-light); color: var(--orange); }
.badge-changesrequired { background: var(--danger-light); color: var(--danger); }
.badge-approved { background: var(--success-light); color: var(--success); }
.badge-scheduled { background: var(--info-light); color: var(--info); }
.badge-posted { background: var(--success-light); color: var(--success); }
.badge-overdue { background: var(--danger-light); color: var(--danger); }
.badge-cancelled { background: var(--border-light); color: var(--text-muted); }

.badge-paid { background: var(--success-light); color: var(--success); }
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-partiallypaid { background: var(--info-light); color: var(--info); }
.badge-overduepayment { background: var(--danger-light); color: var(--danger); }
.badge-paused { background: var(--border-light); color: var(--text-tertiary); }

/* ============================================================
   PLATFORM CHIPS
   ============================================================ */
.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.platform-instagram { background: #FCE7F3; color: #BE185D; }
.platform-facebook { background: #DBEAFE; color: #1D4ED8; }
.platform-youtube { background: #FEE2E2; color: #DC2626; }
.platform-youtubeshorts { background: #FEE2E2; color: #DC2626; }
.platform-linkedin { background: #DBEAFE; color: #0C4A6E; }
.platform-googlebusiness { background: #FEF3C7; color: #B45309; }
.platform-website { background: #E0E7FF; color: #4338CA; }
.platform-whatsapp { background: #D1FAE5; color: #15803D; }
.platform-pinterest { background: #FEE2E2; color: #B91C1C; }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
  margin-left: -6px;
}

.avatar:first-child {
  margin-left: 0;
}

.avatar-group {
  display: flex;
  align-items: center;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

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

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

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

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.progress-fill.success { background: linear-gradient(90deg, var(--success), #34D399); }
.progress-fill.warning { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.progress-fill.danger { background: linear-gradient(90deg, var(--danger), #F87171); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal);
  backdrop-filter: blur(4px);
}

.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: calc(var(--z-modal) + 1);
  width: 90vw;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: modalIn 200ms ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-tertiary);
}

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

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

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg-card);
  z-index: 2;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 13px;
  transition: all var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

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

.form-select {
  cursor: pointer;
}

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

/* Multi Select Chips */
.multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  min-height: 40px;
}

.multi-select:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.multi-select-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

.multi-select-chip .chip-remove {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
}

.multi-select-chip .chip-remove:hover {
  background: rgba(0, 0, 0, 0.1);
}

.multi-select-input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  min-width: 80px;
  font-size: 13px;
  color: var(--text-primary);
}

/* Checkbox */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.checkbox-item:hover {
  border-color: var(--primary);
}

.checkbox-item.selected {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary);
}

.checkbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.checkbox-item::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  flex: 0 0 auto;
}
.checkbox-item.selected::before {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 3px #fff;
}

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

.tab {
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  white-space: nowrap;
}

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

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  right: 16px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  animation: toastIn 250ms ease;
  max-width: 400px;
}

.toast-success {
  background: var(--success);
  color: white;
}

.toast-error {
  background: var(--danger);
  color: white;
}

.toast-warning {
  background: var(--warning);
  color: white;
}

.toast-info {
  background: var(--info);
  color: white;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  gap: var(--space-2);
}

/* ============================================================
   FILTERS
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.filter-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-item label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.filter-item input,
.filter-item select {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

.filter-item input:focus,
.filter-item select:focus {
  border-color: var(--primary);
}

/* ============================================================
   CALENDAR
   ============================================================ */
.calendar-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.calendar-title {
  font-size: 16px;
  font-weight: 700;
}

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

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

.calendar-day-header {
  padding: var(--space-3);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
}

.calendar-day {
  min-height: 100px;
  padding: var(--space-2);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-1);
}

.calendar-day.today .calendar-day-number {
  background: var(--primary);
  color: white;
}

.calendar-day.other-month .calendar-day-number {
  color: var(--text-muted);
}

.calendar-day.sunday {
  background: var(--bg-hover);
}

.calendar-event {
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--transition);
}

.calendar-event:hover {
  opacity: 0.8;
}

/* Calendar List View */
.calendar-list {
  padding: var(--space-4);
}

.calendar-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  transition: background var(--transition);
  margin-bottom: var(--space-1);
}

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

.calendar-list-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
}

.calendar-list-day {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.calendar-list-month {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

/* ============================================================
   KANBAN BOARD
   ============================================================ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  overflow-x: auto;
}

.kanban-column {
  background: var(--bg-hover);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  min-width: 260px;
}

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

.kanban-title {
  font-size: 13px;
  font-weight: 700;
}

.kanban-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-tertiary);
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--transition);
}

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

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

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* Kanban v2 - enhanced styles */
.kanban-column {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kanban-column:hover {
  border-color: var(--primary-30) !important;
}

.kanban-column.drag-over {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-20);
}

.kanban-card {
  user-select: none;
  position: relative;
}

.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
  border-color: var(--primary-30);
}

.kanban-card:hover .card-actions {
  opacity: 1 !important;
}

.kanban-card.dragging {
  opacity: 0.4;
  transform: rotate(2deg);
}

.kanban-card-list {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.kanban-card-list::-webkit-scrollbar {
  width: 4px;
}

.kanban-card-list::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-card-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

/* Drawer content improvements */
.drawer-content {
  padding: var(--space-4) var(--space-5) !important;
}

.drawer-content > * {
  margin-bottom: var(--space-3);
}

.drawer-content h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.drawer-content h4::before {
  content: '';
  display: block;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: currentColor;
}

/* Notification item improvements */
.notif-item {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
}

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

/* Smooth page transitions */
.fade-in {
  animation: fadeInDown 0.3s ease;
}

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

/* ============================================================
   CHARTS
   ============================================================ */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

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

.chart-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-container {
  position: relative;
  width: 100%;
}

.chart-container canvas {
  width: 100% !important;
  height: auto !important;
}

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

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.empty-icon svg {
  width: 32px;
  height: 32px;
  color: var(--text-tertiary);
}

.empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.empty-text {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 360px;
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-active) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 12px;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: var(--space-3);
}

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

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-6);
  background: linear-gradient(135deg, var(--primary-50), var(--bg));
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-8);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.login-logo img {
  width: 48px;
  height: 48px;
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-6);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
}

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

/* ============================================================
   PENDING USER PAGE
   ============================================================ */
.pending-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-6);
}

.pending-card {
  text-align: center;
  max-width: 480px;
}

.pending-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  background: var(--warning-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
}

.pending-icon svg {
  width: 40px;
  height: 40px;
  color: var(--warning);
}

/* ============================================================
   CLIENT PORTAL
   ============================================================ */
.portal-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.portal-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: white;
}

/* ============================================================
   GRID SYSTEM
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

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

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

/* ============================================================
   UTILITIES
   ============================================================ */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

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

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

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

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

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

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

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

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

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

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

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

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

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

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

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  gap: var(--space-4);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .kanban-board {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

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

  .sidebar-close {
    display: flex;
  }

  .main-wrapper {
    margin-left: 0;
  }

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

  .header-search {
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .header-search input {
    display: none;
  }

  .header-search:focus-within input {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: var(--space-3);
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }

  .main-content {
    padding: var(--space-4);
    padding-bottom: calc(64px + var(--space-4));
  }

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

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

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

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

  /* Horizontal Kanban mobile */
  .kanban-row .kanban-card {
    flex: 0 0 260px !important;
  }

  .kanban-row select.form-select {
    min-width: 110px !important;
    font-size: 10px !important;
  }

  .bottom-nav {
    display: flex;
  }

  .calendar-grid {
    display: none;
  }

  .calendar-list {
    display: block;
  }

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

  .page-title {
    font-size: 20px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-item {
    width: 100%;
  }

  .filter-item input,
  .filter-item select {
    width: 100%;
  }

  .install-banner {
    left: 0;
  }

  .drawer {
    width: 100vw;
  }

  .table-container {
    font-size: 12px;
  }

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

  .role-switcher {
    display: none;
  }

  /* Meeting cards mobile */
  .meeting-card .meeting-meta {
    flex-direction: column;
    gap: var(--space-2);
  }

  /* Notice cards mobile */
  .notice-card {
    padding: var(--space-3) !important;
  }

  /* Better mobile typography */
  .card h3 {
    font-size: 14px;
  }

  h1 {
    font-size: 20px !important;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .modal-container {
    width: 95vw;
    max-height: 95vh;
  }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.fade-in {
  animation: fadeInDown 0.3s ease;
}

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

/* ============================================================
   LOGIN MODULE - Compact Premium
   ============================================================ */
.login-module {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  overflow-y: auto; padding: 24px;
}
.login-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #F0F4F8 0%, #E8EEF5 50%, #F5F0FA 100%);
  z-index: -1;
}
[data-theme="dark"] .login-backdrop {
  background: linear-gradient(135deg, #0B1120 0%, #111827 50%, #1A1033 100%);
}
.login-container {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 360px;
  animation: fadeInDown 0.4s ease;
}
.login-logo {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 20px;
}
.login-logo-icon {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 14px; color: #fff;
  font-size: 18px; font-weight: 800;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.login-logo-text {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary); letter-spacing: -0.01em;
}
.login-card {
  width: 100%; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
  overflow: hidden;
}
.login-card-inner {
  padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
.btn-google {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; width: 100%; padding: 10px 16px;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px; font-weight: 600;
  color: var(--text-primary); cursor: pointer;
  transition: all 0.15s ease;
}
.btn-google:hover { background: var(--bg-hover); border-color: var(--border-hover); }
.btn-google:active { transform: scale(0.98); }
.google-icon { width: 18px; height: 18px; flex-shrink: 0; }
.login-divider {
  display: flex; align-items: center; gap: 12px;
}
.login-divider-line { flex: 1; height: 1px; background: var(--border); }
.login-divider-text {
  font-size: 11px; font-weight: 600;
  color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em;
}
.login-tabs {
  display: flex; gap: 4px; padding: 3px;
  background: var(--bg-hover); border-radius: 10px;
}
.login-tab {
  flex: 1; padding: 7px 12px; border: none; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-tertiary);
  background: transparent; cursor: pointer; transition: all 0.15s ease;
}
.login-tab.active {
  background: var(--bg-card); color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form.hidden { display: none; }
.login-field { display: flex; flex-direction: column; gap: 4px; }
.login-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.login-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: var(--bg-primary); color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
  height: 38px; box-sizing: border-box;
}
.login-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-20);
}
.login-input-wrap { position: relative; display: flex; }
.login-input-wrap .login-input { padding-right: 38px; }
.login-eye {
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%); background: none; border: none;
  color: var(--text-tertiary); cursor: pointer; padding: 6px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: color 0.15s;
}
.login-eye:hover { color: var(--text-secondary); }
.btn-login-submit {
  width: 100%; padding: 10px 16px;
  background: var(--primary); border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #fff;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
  height: 38px;
}
.btn-login-submit:hover { background: var(--primary-dark); }
.btn-login-submit:active { transform: scale(0.98); }
.btn-login-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-login-otp {
  width: 100%; padding: 8px; background: none; border: none;
  font-size: 12px; font-weight: 500; color: var(--primary);
  cursor: pointer; transition: color 0.15s; text-align: center;
}
.btn-login-otp:hover { color: var(--primary-dark); text-decoration: underline; }
.otp-boxes { display: flex; gap: 8px; justify-content: center; }
.otp-box {
  width: 40px; height: 44px; text-align: center;
  font-size: 18px; font-weight: 700;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-primary); color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
  caret-color: var(--primary);
}
.otp-box:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-20);
}
.otp-timer { text-align: center; font-size: 12px; color: var(--text-tertiary); margin-top: 8px; }
.login-match-msg { font-size: 11px; font-weight: 600; min-height: 16px; }
.login-match-msg.match { color: var(--success); }
.login-match-msg.mismatch { color: var(--danger); }
.login-msg {
  padding: 10px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 500; text-align: center; display: none;
}
.login-msg.show { display: block; }
.login-msg.info { background: var(--primary-light); color: var(--primary); }
.login-msg.success { background: var(--success-light); color: var(--success); }
.login-msg.error { background: var(--danger-light); color: var(--danger); }
.login-msg.warning { background: var(--warning-light); color: var(--warning); }
.app-shell { display: flex; min-height: 100vh; }
.app-shell.hidden { display: none; }
#install-icon { transition: opacity 0.2s; }
#install-icon:hover { color: var(--primary); }

@media (max-width: 768px) {
  .login-module { padding: 16px; }
  .login-container { max-width: 100%; }
  .login-card-inner { padding: 20px; }
  .login-logo-icon { width: 44px; height: 44px; font-size: 15px; }
  .otp-box { width: 36px; height: 40px; font-size: 16px; }
}

/* Print styles */
@media print {
  .sidebar,
  .header,
  .bottom-nav,
  .install-banner {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .main-content {
    padding: 0;
  }
}

.login-card{max-width:420px!important}.login-container{max-width:440px!important}.header-user{cursor:pointer}.kanban-row.drag-over{outline:2px dashed var(--primary);outline-offset:3px}


/* v12 production header/login/kanban fixes */
.header { gap: 16px; min-width: 0; }
.header-left { min-width: 0; flex: 1; }
.header-right { flex-shrink: 0; gap: 8px; }
.header-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.header-icon-btn:hover { background: var(--bg-hover); color: var(--primary); border-color: var(--primary-100); transform: translateY(-1px); }
.header-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  cursor: pointer;
  min-width: 0;
  max-width: 240px;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.header-user:hover { background: var(--bg-hover); border-color: var(--primary-100); transform: translateY(-1px); }
.header-user #user-name, .header-user #user-role { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}
.kanban-row { border-radius: 16px; padding: 8px 6px 2px; transition: background .16s ease, outline-color .16s ease; }
.kanban-row.drag-over { background: var(--primary-50); outline: 2px dashed var(--primary); outline-offset: 2px; }
.kanban-card:active { cursor: grabbing !important; }
@media (max-width: 768px) {
  .header { padding: 0 12px; gap: 10px; }
  .header-search { width: auto; min-width: 0; flex: 1; }
  .header-user { padding-right: 4px; width: 42px; justify-content: center; }
  .header-user > div:last-child { display: none !important; }
  .header-icon-btn { width: 36px; height: 36px; border-radius: 10px; }
}
@media (max-width: 420px) {
  .header-search { display: none; }
}


/* v14: compact task edit modal + clean status selection */
.task-edit-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.task-edit-full { grid-column:1 / -1; }
.task-edit-form .form-group { margin-bottom:0; }
.task-status-pills { display:flex; flex-wrap:wrap; gap:8px; }
.task-status-pill { border:1px solid var(--border); background:var(--bg); color:var(--text-secondary); border-radius:999px; padding:7px 11px; font-size:12px; font-weight:700; line-height:1; cursor:pointer; transition:all .15s ease; }
.task-status-pill:hover { border-color:var(--primary); color:var(--primary); background:var(--primary-light); }
.task-status-pill.active { border-color:var(--primary); background:var(--primary); color:#fff; }
.modal-container { max-width:520px; overflow:visible; }
.modal-body { max-height:calc(90vh - 140px); overflow-y:auto; }
.modal-footer { border-radius:0 0 var(--radius-xl) var(--radius-xl); }
@media (max-width:640px){ .task-edit-form{grid-template-columns:1fr;} .modal-container{width:94vw;max-width:94vw;} }
