/* =============================================
   WorkSpace Pro — Custom Styles
   Bootstrap 5.3 + Custom Design System
   ============================================= */

:root {
  --primary:       #1186b0;
  --primary-dark:  #0d6889;
  --primary-light: #ddf0f8;
  --secondary:     #0e5c7a;
  --success:       #06d6a0;
  --warning:       #f77f00;
  --danger:        #e63946;
  --info:          #4cc9f0;

  --sidebar-bg:    #0f172a;
  --sidebar-w:     260px;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-active:#1186b0;
  --sidebar-text:  #94a3b8;
  --sidebar-label: #475569;

  --navbar-h:      64px;
  --body-bg:       #f1f5f9;
  --card-bg:       #ffffff;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-md:     0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --transition:    .2s ease;
}

.login-logo-img {
  height: 44px;
  width: auto;
  display: block;
  margin: 0 auto;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .9rem;
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform var(--transition);
  overflow: hidden;
}

/* Brand */
.sidebar-brand {
  padding: 5px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.sidebar-brand a {
  display: block;
  overflow: hidden;
}
.brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
}
.sidebar .brand-mini { display: none; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 0;
}
.nav-section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sidebar-label);
  padding: 12px 8px 4px;
}
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 450;
  margin-bottom: 2px;
  transition: all var(--transition);
}
.sidebar-nav .nav-link i { font-size: 1rem; flex-shrink: 0; }
.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: #f8fafc;
}
.sidebar-nav .nav-link.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(17,134,176,.4);
}
.sidebar-nav .nav-link-danger { color: #f87171; }
.sidebar-nav .nav-link-danger:hover { background: rgba(239,68,68,.15); color: #ef4444; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: .825rem; font-weight: 600; color: #f1f5f9; }
.sidebar-user-role { font-size: .72rem; color: var(--sidebar-text); }

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* =============================================
   MAIN WRAPPER & TOP NAVBAR
   ============================================= */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}
.main-wrapper.sidebar-hidden { margin-left: 64px; }

/* ── Mini sidebar (collapsed) ── */
.sidebar.sidebar-collapsed { width: 64px; }

.sidebar.sidebar-collapsed .brand-full { display: none !important; }
.sidebar.sidebar-collapsed .brand-mini { display: flex !important; align-items: center; justify-content: center; padding: 8px 0; }

.sidebar.sidebar-collapsed .nav-section-label { display: none; }
.sidebar.sidebar-collapsed .nav-link { justify-content: center; padding: 10px; }
.sidebar.sidebar-collapsed .nav-label { display: none; }
.sidebar.sidebar-collapsed .chat-nav-badge { display: none !important; }

.sidebar.sidebar-collapsed .sidebar-footer { justify-content: center; padding: 12px 8px; }
.sidebar.sidebar-collapsed .sidebar-footer .flex-grow-1 { display: none; }
.sidebar.sidebar-collapsed .sidebar-footer a.btn-icon { display: none; }

.top-navbar {
  position: sticky;
  top: 0;
  height: var(--navbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1030;
  box-shadow: var(--shadow-sm);
}

.page-title-nav { color: var(--text-muted); font-size: .875rem; }

.btn-icon {
  width: 38px; height: 38px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}
.btn-icon:hover { background: var(--body-bg); color: var(--text); }

/* Nav date */
.nav-date {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--body-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .8rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Search */
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--body-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  color: var(--text-muted);
}
.nav-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: .85rem;
  color: var(--text);
  width: 200px;
}
.nav-search input::placeholder { color: var(--text-muted); }

/* Notification Badge */
.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  color: #fff;
  border-radius: 99px;
  font-size: .65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* Notifications Dropdown */
.notif-dropdown {
  width: 340px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--body-bg); }
.notif-item.unread { background: var(--primary-light); }
.notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.notif-info    { background: #dbeafe; color: #1d4ed8; }
.notif-success { background: #dcfce7; color: #15803d; }
.notif-warning { background: #fef9c3; color: #a16207; }
.notif-danger  { background: #fee2e2; color: #b91c1c; }
.notif-title   { font-size: .825rem; font-weight: 600; margin: 0 0 2px; color: var(--text); }
.notif-msg     { font-size: .78rem; color: var(--text-muted); margin: 0 0 3px; }
.notif-time    { font-size: .72rem; color: var(--text-muted); }
.notif-empty   { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.notif-empty i { font-size: 2rem; display: block; margin-bottom: 8px; opacity: .4; }
.notif-footer  { padding: 10px 16px; text-align: center; font-size: .825rem; border-top: 1px solid var(--border); }
.notif-footer a { color: var(--primary); font-weight: 500; }

/* User Menu */
.user-menu-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: .875rem;
  transition: all var(--transition);
}
.user-menu-btn:hover { background: var(--body-bg); border-color: var(--primary); }
.user-name-nav { font-size: .825rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-role-nav { font-size: .7rem; color: var(--text-muted); line-height: 1.2; }

.user-dropdown {
  min-width: 230px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0;
  overflow: hidden;
}
.user-dropdown-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
}
.user-dropdown .dropdown-item {
  padding: 8px 16px;
  font-size: .85rem;
  display: flex; align-items: center;
}
.user-dropdown .dropdown-item:hover { background: var(--body-bg); }

/* Avatar */
.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  flex-shrink: 0;
}
.user-avatar-md {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.user-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.8rem;
}
.avatar-upload-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.avatar-upload-wrap .avatar-overlay {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  color: #fff;
  font-size: .9rem;
}
.avatar-upload-wrap:hover .avatar-overlay { opacity: 1; }

/* =============================================
   PAGE CONTENT
   ============================================= */
.page-content { padding: 24px; flex: 1; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.page-header .subtitle {
  font-size: .875rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* Breadcrumb */
.breadcrumb { margin: 0; font-size: .8rem; }
.breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--text-muted); }
.breadcrumb-item a { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-muted); }

/* Flash */
.flash-container { padding: 12px 24px 0; }
.flash-container .alert { border-radius: var(--radius-sm); font-size: .875rem; }

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 20px; }

/* Stat Cards */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  overflow: hidden;
  position: relative;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: .06;
  background: currentColor;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card-link { display: block; text-decoration: none; color: inherit; }
.stat-card-link:hover .stat-card { box-shadow: var(--shadow-md); transform: translateY(-2px); cursor: pointer; }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #ddf0f8; color: var(--primary); }
.stat-icon.green  { background: #dcfce7; color: #15803d; }
.stat-icon.orange { background: #fef3c7; color: #d97706; }
.stat-icon.red    { background: #fee2e2; color: #dc2626; }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.stat-icon.teal   { background: #ccfbf1; color: #0d9488; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.stat-trend { font-size: .75rem; margin-top: 4px; }
.stat-trend.up   { color: #16a34a; }
.stat-trend.down { color: var(--danger); }

/* =============================================
   TABLES
   ============================================= */
.table-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.table { margin: 0; font-size: .875rem; }
.table thead th {
  background: var(--body-bg);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }

/* =============================================
   BADGES & STATUS
   ============================================= */
.status-badge, .priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.badge-todo      { background: #f1f5f9; color: #475569; }
.badge-progress  { background: #dbeafe; color: #1d4ed8; }
.badge-review    { background: #fef9c3; color: #92400e; }
.badge-done      { background: #dcfce7; color: #15803d; }

.priority-low    { background: #f0fdf4; color: #16a34a; }
.priority-medium { background: #fefce8; color: #ca8a04; }
.priority-high   { background: #fff7ed; color: #ea580c; }
.priority-urgent { background: #fef2f2; color: #dc2626; }

/* Role badges */
.role-admin    { background: #f3e8ff; color: #7c3aed; }
.role-manager  { background: #dbeafe; color: #1d4ed8; }
.role-employee { background: #f0fdf4; color: #16a34a; }
.role-intern   { background: #fff7ed; color: #c2410c; }
.role-trainee  { background: #ecfeff; color: #0e7490; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: #0d6889;
  border-color: #0d6889;
  box-shadow: 0 4px 12px rgba(17,134,176,.35);
  transform: translateY(-1px);
}
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-xs { padding: 3px 8px; font-size: .75rem; }

/* =============================================
   FORMS
   ============================================= */
.form-label { font-weight: 500; font-size: .85rem; color: var(--text); margin-bottom: 6px; }
.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text);
  padding: 8px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17,134,176,.18);
  outline: none;
}
.form-control::placeholder { color: #94a3b8; }
.input-group-text {
  background: var(--body-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .875rem;
}
.form-section {
  background: var(--body-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.form-section-title {
  font-weight: 600;
  font-size: .85rem;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* =============================================
   KANBAN BOARD
   ============================================= */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}
.kanban-column {
  background: var(--body-bg);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.kanban-cards-body {
  overflow-y: auto;
  max-height: calc(100vh - 310px);
  min-height: 60px;
  padding-right: 2px;
}
.kanban-cards-body::-webkit-scrollbar { width: 4px; }
.kanban-cards-body::-webkit-scrollbar-track { background: transparent; }
.kanban-cards-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.kanban-cards-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.kanban-col-title {
  font-weight: 600;
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-col-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.dot-todo        { background: #94a3b8; }
.dot-in_progress { background: var(--primary); }
.dot-review      { background: #f59e0b; }
.dot-done        { background: #22c55e; }

.kanban-col-count {
  background: rgba(0,0,0,.08);
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}
.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}
.kanban-card { position: relative; overflow: hidden; }
.kanban-card-has-bg::before {
  content: '';
  position: absolute;
  inset: 8px 12px;
  background-image: var(--card-logo);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  opacity: 0.15;
  pointer-events: none;
}
.kanban-card-title { font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--text); }
.kanban-card-meta  { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.kanban-card-client { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.kanban-card-due   { font-size: .72rem; padding: 2px 6px; border-radius: 99px; }
.due-ok    { background: #dcfce7; color: #15803d; }
.due-soon  { background: #fef9c3; color: #92400e; }
.due-over  { background: #fee2e2; color: #dc2626; }
.kanban-add { color: var(--text-muted); font-size: .8rem; text-align: center; padding: 8px; border-radius: var(--radius-sm); border: 2px dashed var(--border); cursor: pointer; transition: all var(--transition); }
.kanban-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.kanban-card.dragging { opacity: .35; box-shadow: none !important; transform: none !important; }
.kanban-column.drag-over { background: var(--primary-light); border-color: var(--primary); border-style: dashed; }

/* =============================================
   TASK CARD (list view)
   ============================================= */
.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.task-row:hover { background: #f8fafc; }
.task-row:last-child { border-bottom: none; }
.task-priority-indicator {
  width: 4px;
  min-height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
}
.pi-low    { background: #22c55e; }
.pi-medium { background: #f59e0b; }
.pi-high   { background: #f97316; }
.pi-urgent { background: var(--danger); }
.task-title-link { font-weight: 600; font-size: .875rem; color: var(--text); }
.task-title-link:hover { color: var(--primary); }
.task-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.task-meta-item { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* =============================================
   PROFILE & SETTINGS
   ============================================= */
.profile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius);
  padding: 32px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}
.profile-hero .user-avatar-lg { border: 3px solid rgba(255,255,255,.4); }
.profile-hero-name { font-size: 1.4rem; font-weight: 700; }
.profile-hero-role { opacity: .8; font-size: .875rem; }
.profile-hero-info { display: flex; gap: 20px; margin-top: 10px; flex-wrap: wrap; }
.profile-info-item { font-size: .825rem; opacity: .9; display: flex; align-items: center; gap: 6px; }

/* =============================================
   REPORTS / CHARTS
   ============================================= */
.chart-wrapper { position: relative; }

/* =============================================
   FILTERS & TOOLBAR
   ============================================= */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-group .form-select { min-width: 130px; }

/* =============================================
   EMPTY STATES
   ============================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i   { font-size: 3rem; opacity: .3; display: block; margin-bottom: 12px; }
.empty-state h5  { font-size: 1rem; color: var(--text); margin-bottom: 6px; }
.empty-state p   { font-size: .875rem; margin-bottom: 16px; }

/* =============================================
   ACTIVITY FEED
   ============================================= */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}
.activity-text  { font-size: .825rem; color: var(--text); }
.activity-time  { font-size: .75rem; color: var(--text-muted); }

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0,0,0,.3);
  overflow: hidden;
  width: 100%;
  max-width: 420px;
}
.login-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 32px 32px 24px;
  text-align: center;
  color: var(--text);
}
.login-header h1 { font-size: 1rem; font-weight: 600; margin: 0 0 2px; color: var(--text); }
.login-header p  { font-size: .825rem; color: var(--text-muted); margin: 0; }
.login-body { padding: 32px; }

/* =============================================
   SETUP PAGE
   ============================================= */
.setup-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.setup-box {
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0,0,0,.3);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
}

/* =============================================
   CLIENT LOGO
   ============================================= */

/* Card thumbnail */
.client-logo-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.client-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.client-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--body-bg);
  border: 1px solid var(--border);
  font-size: .95rem;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.client-social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}

/* Upload form preview */
.logo-preview-wrap {
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  background: var(--body-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.logo-preview-wrap:has(img:not(.d-none)) {
  border-style: solid;
  border-color: var(--primary);
  background: #fff;
}
.logo-preview-placeholder {
  font-size: 2rem;
  color: #cbd5e1;
}
.logo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  transition: opacity var(--transition);
}

/* ── Presence (online/offline) dot ────────────────────── */
.presence-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--card-bg);
  position: absolute;
  bottom: 0; right: 0;
  transform: translate(25%, 25%);
  flex-shrink: 0;
}
.presence-online  { background: #22c55e; }
.presence-offline { background: #94a3b8; }

/* Kanban / task card small logo */
.client-logo-xs {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

/* =============================================
   ANNOUNCEMENTS
   ============================================= */
.ann-card {
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 4px solid transparent;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ann-card.ann-late        { border-left-color: #f97316; background: #fff7ed; }
.ann-card.ann-half        { border-left-color: #eab308; background: #fefce8; }
.ann-card.ann-absent      { border-left-color: #ef4444; background: #fef2f2; }
.ann-card.ann-wfh         { border-left-color: #3b82f6; background: #eff6ff; }
.ann-card.ann-meeting     { border-left-color: #10b981; background: #ecfdf5; }
.ann-card.ann-out-meeting { border-left-color: #06b6d4; background: #ecfeff; }
.ann-card.ann-out-shoot   { border-left-color: #a855f7; background: #faf5ff; }
.ann-card.ann-out-lunch   { border-left-color: #f59e0b; background: #fffbeb; }
.ann-card.ann-back-office { border-left-color: #22c55e; background: #f0fdf4; }
.ann-card.ann-other       { border-left-color: #8b5cf6; background: #f5f3ff; }

.ann-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.ann-late-badge        { background:#ffedd5; color:#c2410c; }
.ann-half-badge        { background:#fef9c3; color:#a16207; }
.ann-absent-badge      { background:#fee2e2; color:#b91c1c; }
.ann-wfh-badge         { background:#dbeafe; color:#1d4ed8; }
.ann-meeting-badge     { background:#d1fae5; color:#065f46; }
.ann-out-meeting-badge { background:#cffafe; color:#0e7490; }
.ann-out-shoot-badge   { background:#f3e8ff; color:#7e22ce; }
.ann-out-lunch-badge   { background:#fef3c7; color:#b45309; }
.ann-back-office-badge { background:#dcfce7; color:#15803d; }
.ann-other-badge       { background:#ede9fe; color:#6d28d9; }

/* Dashboard announcement card */
.ann-dashboard-item:last-child { border-bottom: none !important; }

/* Birthday banner */
.birthday-banner {
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid #fde68a;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 2px 12px rgba(245,158,11,.12);
}
.birthday-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #fde68a;
}
.birthday-item:last-child { border-bottom: none; }
.birthday-icon-wrap { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.birthday-name { font-weight: 700; font-size: .95rem; color: #92400e; }
.birthday-dept { font-size: .75rem; color: #b45309; margin-top: 2px; }
.birthday-wish {
  font-size: .78rem;
  color: #b45309;
  background: rgba(245,158,11,.15);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* =============================================
   FLOATING CHAT WIDGET
   ============================================= */
.fcw-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1055;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Toggle button */
.fcw-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(17,134,176,.45);
  transition: transform .15s, background .2s;
  position: relative;
  flex-shrink: 0;
}
.fcw-btn:hover { transform: scale(1.06); background: var(--primary-dark); }

.fcw-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--danger);
  color: #fff;
  border-radius: 99px;
  font-size: .62rem;
  font-weight: 700;
  min-width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

/* Panel */
.fcw-panel {
  width: 360px;
  height: 500px;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fcwIn .18s ease;
}
@keyframes fcwIn { from { opacity:0; transform:translateY(12px) scale(.97); } to { opacity:1; transform:none; } }

/* Panel header */
.fcw-header {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 10px 10px 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--card-bg);
}
.btn-icon-sm { width: 30px; height: 30px; font-size: .85rem; }

/* Search bar inside panel */
.fcw-search-bar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Scrollable list area */
.fcw-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  max-height: 415px;
}

/* Conversation rows */
.fcw-conv {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background var(--transition);
}
.fcw-conv:hover  { background: var(--body-bg); }
.fcw-conv.active { background: var(--primary-light); border-left-color: var(--primary); }
.fcw-conv-info   { flex: 1; min-width: 0; }
.fcw-conv-name   { font-size: .825rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcw-conv-last   { font-size: .73rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.fcw-conv-meta   { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.fcw-conv-time   { font-size: .68rem; color: var(--text-muted); }
.fcw-dot         { background: var(--primary); color: #fff; border-radius: 99px; font-size: .62rem; font-weight: 700; min-width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; padding: 0 3px; }
.fcw-empty       { text-align: center; padding: 24px 16px; color: var(--text-muted); font-size: .825rem; line-height: 1.7; }

/* Avatar in widget */
.fcw-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Group form */
.fcw-group-form  { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.fcw-group-scroll{ max-height: 240px !important; }
.fcw-group-footer{ padding: 8px 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.fcw-chips-bar   { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 12px; min-height: 0; border-bottom: 1px solid var(--border); }
.fcw-chips-bar:empty { display: none; }
.fcw-chip        { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-light); color: var(--primary); border-radius: 99px; padding: 2px 8px 2px 3px; font-size: .75rem; font-weight: 500; }

/* Selectable row (group member pick) */
.fcw-selectable  { position: relative; }
.fcw-selectable.selected { background: var(--primary-light); border-left-color: var(--primary); }
.fcw-check       { color: var(--primary); font-size: .9rem; margin-left: auto; opacity: 0; flex-shrink: 0; }
.fcw-check.visible { opacity: 1; }

/* Chat view */
.fcw-chat     { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.fcw-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.fcw-input-row { padding: 8px 10px; border-top: 1px solid var(--border); display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0; }

/* =============================================
   CHAT
   ============================================= */
.chat-wrapper {
  display: flex;
  height: calc(100vh - var(--navbar-h));
  overflow: hidden;
  background: var(--body-bg);
}

/* Left sidebar */
.chat-sidebar {
  width: 290px;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.chat-sidebar-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--body-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
}
.chat-search-wrap i { color: var(--text-muted); font-size: .85rem; flex-shrink: 0; }
.chat-search-input {
  border: none; outline: none;
  background: transparent;
  font-size: .85rem;
  color: var(--text);
  width: 100%;
}
.chat-search-input::placeholder { color: var(--text-muted); }
.chat-conv-list { flex: 1; overflow-y: auto; }
.chat-conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background var(--transition);
}
.chat-conv-item:hover  { background: var(--body-bg); }
.chat-conv-item.active { background: var(--primary-light); border-left-color: var(--primary); }
.chat-conv-info   { flex: 1; min-width: 0; }
.chat-conv-name   { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-last   { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.chat-conv-meta   { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-conv-time   { font-size: .7rem; color: var(--text-muted); }
.chat-unread-dot  { background: var(--primary); color: #fff; border-radius: 99px; font-size: .65rem; font-weight: 700; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.chat-no-convs    { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: .85rem; line-height: 1.6; }

/* Empty state */
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); text-align: center; padding: 24px; }
.chat-empty > i { font-size: 4rem; opacity: .2; }

/* Main panel */
.chat-main    { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-header  { padding: 12px 20px; background: var(--card-bg); border-bottom: 1px solid var(--border); flex-shrink: 0; min-height: 60px; display: flex; align-items: center; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.chat-loading  { text-align: center; color: var(--text-muted); padding: 32px; font-size: .875rem; }

/* Bubbles */
.chat-bubble-wrap      { display: flex; align-items: flex-end; gap: 8px; max-width: 70%; }
.chat-bubble-wrap.own  { flex-direction: row-reverse; margin-left: auto; }
.chat-bubble           { padding: 9px 13px; border-radius: 16px; font-size: .875rem; line-height: 1.5; word-break: break-word; }
.chat-bubble.theirs    { background: var(--card-bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-bubble.mine      { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble-meta      { font-size: .68rem; color: var(--text-muted); margin-top: 2px; padding: 0 2px; }
.chat-sender-name      { font-size: .72rem; font-weight: 600; color: var(--primary); margin-bottom: 3px; }
.chat-date-sep         { display: flex; align-items: center; gap: 10px; font-size: .7rem; color: var(--text-muted); margin: 8px 0; }
.chat-date-sep::before,.chat-date-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Input */
.chat-input-area { padding: 12px 16px; background: var(--card-bg); border-top: 1px solid var(--border); display: flex; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.chat-input      { flex: 1; border: 1px solid var(--border); border-radius: 20px; padding: 9px 16px; font-size: .875rem; line-height: 1.5; outline: none; resize: none; max-height: 120px; font-family: inherit; background: var(--body-bg); transition: border-color var(--transition); overflow-y: auto; }
.chat-input:focus { border-color: var(--primary); }
.chat-send-btn   { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: background var(--transition); }
.chat-send-btn:hover { background: var(--primary-dark); }

/* Modal user list */
.chat-user-list   { max-height: 300px; overflow-y: auto; }
.chat-user-pick   { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition); }
.chat-user-pick:hover   { background: var(--body-bg); }
.chat-user-pick.selected { background: var(--primary-light); }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-chip  { display: inline-flex; align-items: center; gap: 5px; background: var(--primary-light); color: var(--primary); border-radius: 99px; padding: 2px 10px 2px 4px; font-size: .78rem; font-weight: 500; }

/* Sidebar nav badge */
.chat-nav-badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 99px; font-size: .65rem; font-weight: 700; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

/* Spin */
@keyframes chat-spin { to { transform: rotate(360deg); } }
.chat-spin { display: inline-block; animation: chat-spin .8s linear infinite; }

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 0 0 60px rgba(0,0,0,.5);
  }
  .main-wrapper { margin-left: 0; }
  .page-content { padding: 16px; }
  .kanban-board { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-hero-info { justify-content: center; }
}

@media (max-width: 576px) {
  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.4rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filter-group { flex-direction: column; }
}

/* =============================================
   UTILITIES
   ============================================= */
.text-primary  { color: var(--primary) !important; }
.bg-primary    { background: var(--primary) !important; }
.border-primary{ border-color: var(--primary) !important; }
.rounded-xl    { border-radius: var(--radius) !important; }
.shadow-card   { box-shadow: var(--shadow) !important; }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }
.fs-xs         { font-size: .75rem; }
.fs-sm         { font-size: .85rem; }
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp .3s ease both; }
.animate-in:nth-child(1) { animation-delay: .05s; }
.animate-in:nth-child(2) { animation-delay: .10s; }
.animate-in:nth-child(3) { animation-delay: .15s; }
.animate-in:nth-child(4) { animation-delay: .20s; }

/* ── Break Button ──────────────────────────────────────────────────────────── */
.break-active-btn {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 600;
    padding: 5px 10px;
    gap: 5px;
    transition: background .15s;
}
.break-active-btn:hover { background: #fde68a; color: #78350f; }

.break-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    flex-shrink: 0;
    animation: breakPulse 1.4s ease-in-out infinite;
}
@keyframes breakPulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .4; transform: scale(1.4); }
}

.break-elapsed { font-size: .72rem; color: #b45309; font-weight: 500; }

.break-dropdown { padding: 4px 0; min-width: 200px; }
.break-dropdown-header {
    padding: 6px 14px 4px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.break-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    white-space: nowrap;
}
.break-option-icon { font-size: 1.1rem; line-height: 1; }
.break-option .fw-600 { font-size: .85rem; line-height: 1.2; }
.break-option-sub { font-size: .72rem; color: var(--text-muted); }

/* ── Platform checkbox pills ───────────────────────────────────────────────── */
.platform-checkbox-label { display:inline-flex; cursor:pointer; user-select:none; }
.platform-cb-input       { display:none; }
.platform-cb-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: .82rem;
    font-weight: 600;
    transition: border-color .15s, background .15s, color .15s;
}
.platform-cb-input:checked + .platform-cb-pill {
    border-color: var(--plat-color);
    background: color-mix(in srgb, var(--plat-color) 12%, white);
    color: var(--plat-color);
}
.platform-checkbox-label:hover .platform-cb-pill {
    border-color: var(--plat-color);
    color: var(--plat-color);
}
