/* ===== CEKAT SA DASHBOARD STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== VARIABLES ===== */
:root {
  --bg-main: #f4f7fe;
  --bg-white: #ffffff;
  --sidebar: #ffffff;
  --border: #e9ecef;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
}

[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-white: #1e293b;
  --sidebar: #1e293b;
  --border: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
}

/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ===== LOGIN PAGE ===== */
#login-page {
  display: flex;
  min-height: 100vh;
}

.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-white);
}

.login-form {
  width: 100%;
  max-width: 440px;
}

.login-header {
  margin-bottom: 40px;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.google-btn-wrapper {
  margin: 32px 0 40px 0;
}

.login-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.login-right {
  flex: 1;
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: white;
}

.login-logo {
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  font-weight: 800;
  margin-bottom: 32px;
}

.login-brand {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 12px;
}

.login-tagline {
  font-size: 18px;
  opacity: 0.9;
}

/* ===== DASHBOARD LAYOUT ===== */
#dashboard {
  display: none;
  min-height: 100vh;
}

#dashboard.active {
  display: flex;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 50;
  transition: all 0.3s ease;
}

.sidebar.collapsed {
  width: 70px;
  padding: 20px 8px;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-subtitle,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .nav-label {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 8px;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 24px;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: white;
}

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

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

/* Navigation */
.nav-section {
  margin-bottom: 20px;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  padding: 0 12px;
  margin-bottom: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 3px;
}

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

.nav-item.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.25);
}

.nav-icon {
  font-size: 18px;
}

/* ===== TOP BAR ===== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: 260px;
  transition: margin-left 0.3s ease;
}

.main-wrapper.sidebar-collapsed {
  margin-left: 70px;
}

.top-bar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
  color: var(--text-primary);
}

.hamburger-btn:hover {
  background: var(--border);
}

.page-header {
  display: flex;
  flex-direction: column;
}

.breadcrumb {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

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

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.theme-toggle:hover {
  background: var(--border);
  transform: scale(1.1);
}

/* Sync Indicator */
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-main);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.sync-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  background: var(--bg-main);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-menu:hover {
  background: var(--border);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
}

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

/* ===== CONTENT ===== */
.content {
  flex: 1;
  padding: 20px 24px;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card.accent::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.stat-card.warning::before {
  background: linear-gradient(90deg, var(--warning), #ffca28);
}

.stat-card.success::before {
  background: linear-gradient(90deg, var(--success), #00e396);
}

.stat-card.info::before {
  background: linear-gradient(90deg, var(--info), #4facfe);
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1;
}

.stat-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ===== SECTION ===== */
.section {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

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

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

.section-count {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: 6px;
  font-weight: 400;
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-select {
  padding: 7px 12px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  min-width: 130px;
}

.filter-chips {
  display: flex;
  gap: 7px;
}

.filter-chip {
  padding: 7px 12px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ===== TABLE ===== */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

thead {
  background: var(--bg-main);
}

th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}

tr:hover {
  background: rgba(59, 130, 246, 0.02);
}

.sa-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.sa-avatar {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
}

.avatar-naufal { background: linear-gradient(135deg, #667eea, #764ba2); }
.avatar-della { background: linear-gradient(135deg, #f093fb, #f5576c); }
.avatar-bagus { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.avatar-wivin { background: linear-gradient(135deg, #43e97b, #38f9d7); }

/* Badges */
.status-badge {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-active { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-done { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-hold { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

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

.complexity-high { color: var(--danger); }
.complexity-medium { color: var(--warning); }
.complexity-low { color: var(--success); }

/* Notes Tooltip */
.notes-cell {
  position: relative;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
  font-size: 12px;
  color: var(--text-primary);
}

.notes-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--text-primary);
  color: white;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 11px;
  max-width: 300px;
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  white-space: normal;
  line-height: 1.4;
}

.notes-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 20px;
  border: 6px solid transparent;
  border-top-color: var(--text-primary);
}

.notes-cell:hover .notes-tooltip {
  display: block;
}

/* ===== SEARCH PAGE ===== */
.search-box-large {
  position: relative;
  margin-bottom: 24px;
}

.search-input-large {
  width: 100%;
  padding: 14px 50px 14px 18px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
}

.search-input-large:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-icon-large {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-tertiary);
}

.empty-search {
  text-align: center;
  padding: 60px 20px;
}

.empty-search .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-search .empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-search .empty-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== SA BOARD ===== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.kanban-column {
  background: var(--bg-main);
  border-radius: 10px;
  padding: 14px;
}

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

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.column-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.column-count {
  padding: 3px 8px;
  background: var(--bg-white);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.task-card-mini {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.task-card-mini:hover {
  border-color: var(--accent);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.task-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.more-tasks {
  text-align: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

/* ===== WIP STATE ===== */
.wip-state {
  text-align: center;
  padding: 100px 20px;
  background: var(--bg-white);
  border-radius: 12px;
}

.wip-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.7;
}

.wip-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.wip-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.wip-badge {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* ===== PAGES ===== */
.page-content {
  display: none;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .login-right {
    display: none;
  }
  
  .sidebar {
    width: 240px;
  }
  
  .sidebar.collapsed {
    width: 70px;
  }
  
  .main-wrapper {
    margin-left: 240px;
  }
  
  .main-wrapper.sidebar-collapsed {
    margin-left: 70px;
  }
}

@media (max-width: 768px) {
  #dashboard {
    flex-direction: column;
  }
  
  /* Hide sidebar by default on mobile */
  .sidebar {
    position: fixed;
    width: 260px;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }
  
  /* Show sidebar when active */
  .sidebar.mobile-active {
    left: 0;
  }
  
  /* Overlay when sidebar open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  .sidebar.collapsed {
    width: 260px;
    left: -260px;
  }
  
  .main-wrapper {
    margin-left: 0;
  }
  
  .main-wrapper.sidebar-collapsed {
    margin-left: 0;
  }
  
  .content {
    padding: 16px;
  }
  
  .stats-row {
    grid-template-columns: 1fr;
  }
  
  .top-bar {
    padding: 12px 16px;
  }
  
  .top-bar-left {
    gap: 12px;
  }
  
  .top-bar-right {
    gap: 8px;
  }
  
  .page-title {
    font-size: 16px;
  }
  
  .breadcrumb {
    font-size: 10px;
  }
  
  .table-wrapper {
    font-size: 12px;
  }
  
  .kanban-board {
    grid-template-columns: 1fr;
  }
  
  /* Make theme toggle and sync smaller on mobile */
  .theme-toggle,
  .sync-indicator {
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .user-menu {
    padding: 4px 8px 4px 4px;
  }
  
  .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .user-name {
    font-size: 12px;
  }
}
