/* ═══════════════════════════════════════════════════════════════
   SkulBest - Modern Project Management & Team Collaboration
   System fonts, no external CDN dependencies
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --transition: 0.15s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--gray-800); background: var(--gray-50); line-height: 1.6; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ─── Layout ─────────────────────────────────────────────────── */

.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--gray-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
}

.sidebar-brand { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section { margin-bottom: 24px; }
.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--gray-300);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-link:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.nav-link.active { background: var(--primary); color: var(--white); }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover { background: rgba(255,255,255,0.08); }

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

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

.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}

.page-header {
  padding: 24px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title { font-size: 24px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.5px; }
.page-subtitle { font-size: 14px; color: var(--gray-500); margin-top: 2px; }

.page-body { padding: 32px; }

/* ─── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--transition);
  line-height: 1;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--white); color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--gray-600); padding: 8px 12px; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }

/* ─── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-100); }
.card-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.card-body { padding: 24px; }

/* ─── Stats Grid ─────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.stat-label { font-size: 13px; font-weight: 500; color: var(--gray-500); margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }
.stat-card.accent { border-left: 4px solid var(--primary); }

/* ─── Table ──────────────────────────────────────────────────── */

.table-container { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
tr:hover td { background: var(--gray-50); }

/* ─── Badges ─────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.badge-primary { background: var(--primary-bg); color: var(--primary-dark); }
.badge-success { background: var(--success-bg); color: #059669; }
.badge-warning { background: var(--warning-bg); color: #d97706; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ─── Forms ──────────────────────────────────────────────────── */

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

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

.form-error { color: var(--danger); font-size: 13px; margin-top: 4px; }

/* ─── Modal ──────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--gray-400); font-size: 20px; padding: 4px; }
.modal-close:hover { color: var(--gray-700); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; gap: 12px; justify-content: flex-end; }

/* ─── Toast ──────────────────────────────────────────────────── */

.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }

.toast {
  background: var(--gray-900);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

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

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

/* ─── Landing Page ───────────────────────────────────────────── */

.landing { min-height: 100vh; }

.landing-nav {
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}

.landing-nav-brand { display: flex; align-items: center; gap: 10px; }
.landing-nav-links { display: flex; align-items: center; gap: 8px; }
.landing-nav-links a, .landing-nav-links button { font-size: 14px; font-weight: 500; }

.landing-hero {
  padding: 80px 32px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-bg) 0%, #fce7f3 100%);
}

.landing-hero h1 {
  font-size: 48px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -1px;
  margin-bottom: 16px;
  line-height: 1.1;
}

.landing-hero h1 span { color: var(--primary); }

.landing-hero p {
  font-size: 18px;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.landing-features {
  padding: 80px 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.landing-features h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}

.landing-features > p {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: box-shadow var(--transition);
}

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

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--gray-500); line-height: 1.6; }

.landing-cta {
  padding: 80px 32px;
  text-align: center;
  background: var(--gray-900);
  color: var(--white);
}

.landing-cta h2 { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.landing-cta p { color: var(--gray-400); margin-bottom: 32px; font-size: 16px; }

.landing-footer {
  padding: 32px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
}

/* ─── Login Page ─────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-bg) 0%, #fce7f3 100%);
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 40px;
}

.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.login-header p { font-size: 14px; color: var(--gray-500); }

/* ─── Empty State ────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 24px; }

/* ─── Filter Bar ─────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-bar .form-input { max-width: 300px; }
.filter-bar .form-select { max-width: 160px; }

/* ─── Record List ────────────────────────────────────────────── */

.record-list { display: flex; flex-direction: column; gap: 12px; }

.record-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow var(--transition);
}

.record-item:hover { box-shadow: var(--shadow-sm); }

.record-type-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.record-type-icon.project { background: #dbeafe; color: #2563eb; }
.record-type-icon.task { background: #fef3c7; color: #d97706; }
.record-type-icon.note { background: #e0e7ff; color: var(--primary); }

.record-body { flex: 1; min-width: 0; }
.record-title { font-size: 15px; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; }
.record-desc { font-size: 13px; color: var(--gray-500); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.record-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.record-actions { display: flex; gap: 4px; align-items: flex-start; flex-shrink: 0; }

/* ─── Team Grid ──────────────────────────────────────────────── */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.team-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.team-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
}

.team-card h3 { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.team-card .team-email { font-size: 13px; color: var(--gray-500); margin-bottom: 8px; }
.team-card .team-dept { font-size: 13px; color: var(--gray-400); }

/* ─── Integration Cards ──────────────────────────────────────── */

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.integration-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.integration-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.integration-body { flex: 1; }
.integration-body h3 { font-size: 15px; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; }
.integration-body p { font-size: 13px; color: var(--gray-500); margin-bottom: 12px; }

/* ─── Toggle Switch ──────────────────────────────────────────── */

.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--gray-300);
  border-radius: 99px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ─── Contact Page ───────────────────────────────────────────── */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.contact-info { display: flex; flex-direction: column; gap: 24px; }

.contact-item { display: flex; gap: 16px; }
.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-item h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.contact-item p { font-size: 13px; color: var(--gray-500); }

/* ─── Admin Settings ─────────────────────────────────────────── */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ─── Mobile Nav ─────────────────────────────────────────────── */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--gray-900);
  z-index: 99;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.mobile-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  padding: 4px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-overlay { display: none; }

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; padding-top: 56px; }
  .page-header { padding: 16px 20px; }
  .page-body { padding: 20px; }
  .page-title { font-size: 20px; }
  .landing-hero h1 { font-size: 32px; }
  .landing-hero { padding: 48px 20px; }
  .landing-features { padding: 48px 20px; }
  .contact-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-input, .filter-bar .form-select { max-width: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px; }
  .landing-hero h1 { font-size: 28px; }
}
