/* =============================================
   MyCloud - Neon Dark Theme
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base: #080b14;
  --bg-card: #0d1117;
  --bg-card2: #111827;
  --bg-input: #0a0f1a;
  --border: #1e2d47;
  --border-glow: #1e3a5f;

  --neon-blue: #00d4ff;
  --neon-purple: #b347ea;
  --neon-green: #00ff88;
  --neon-pink: #ff2d78;
  --neon-orange: #ff7c2a;
  --neon-yellow: #ffd700;

  --text-primary: #e2e8f0;
  --text-secondary: #64748b;
  --text-muted: #334155;

  --gradient-main: linear-gradient(135deg, #00d4ff 0%, #b347ea 100%);
  --gradient-green: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
  --gradient-pink: linear-gradient(135deg, #ff2d78 0%, #b347ea 100%);
  --gradient-warm: linear-gradient(135deg, #ff7c2a 0%, #ffd700 100%);

  --shadow-neon: 0 0 20px rgba(0, 212, 255, 0.3);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-blue); }

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

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

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--gradient-main);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1px;
}

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

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(0, 212, 255, 0.08);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(0, 212, 255, 0.12);
  color: var(--neon-blue);
  border-left: 3px solid var(--neon-blue);
}

.nav-item .nav-icon { font-size: 18px; width: 24px; text-align: center; }

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--neon-pink);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

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

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--bg-card2);
  cursor: pointer;
  transition: var(--transition);
}

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

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--bg-base);
  flex-shrink: 0;
}

.user-info .user-name { font-size: 13px; font-weight: 600; }
.user-info .user-role {
  font-size: 10px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  width: 280px;
  transition: var(--transition);
}

.topbar-search:focus-within {
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

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

.topbar-search input::placeholder { color: var(--text-secondary); }

.page-content {
  flex: 1;
  padding: 28px;
}

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

.card:hover { border-color: var(--border-glow); }

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

.card-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =============================================
   STAT CARDS
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient);
}

.stat-card:hover { transform: translateY(-2px); border-color: var(--border-glow); }

.stat-card.blue { --gradient: var(--gradient-main); }
.stat-card.green { --gradient: var(--gradient-green); }
.stat-card.pink { --gradient: var(--gradient-pink); }
.stat-card.warm { --gradient: var(--gradient-warm); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-card.blue .stat-icon { background: rgba(0, 212, 255, 0.12); }
.stat-card.green .stat-icon { background: rgba(0, 255, 136, 0.12); }
.stat-card.pink .stat-icon { background: rgba(255, 45, 120, 0.12); }
.stat-card.warm .stat-icon { background: rgba(255, 124, 42, 0.12); }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card.blue .stat-value { color: var(--neon-blue); }
.stat-card.green .stat-value { color: var(--neon-green); }
.stat-card.pink .stat-value { color: var(--neon-pink); }
.stat-card.warm .stat-value { color: var(--neon-orange); }

.stat-label { font-size: 12px; color: var(--text-secondary); }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-main);
  color: var(--bg-base);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.3);
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(0, 212, 255, 0.5); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--neon-blue); color: var(--neon-blue); }

.btn-danger {
  background: rgba(255, 45, 120, 0.15);
  border: 1px solid rgba(255, 45, 120, 0.3);
  color: var(--neon-pink);
}
.btn-danger:hover { background: rgba(255, 45, 120, 0.25); }

.btn-success {
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: var(--neon-green);
}
.btn-success:hover { background: rgba(0, 255, 136, 0.2); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-icon:hover { border-color: var(--neon-blue); color: var(--neon-blue); }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

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

/* =============================================
   BADGES / STATUS
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-todo { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.badge-progress { background: rgba(0, 212, 255, 0.15); color: var(--neon-blue); }
.badge-done { background: rgba(0, 255, 136, 0.15); color: var(--neon-green); }
.badge-cancelled { background: rgba(255, 45, 120, 0.1); color: #f87171; }
.badge-overdue { background: rgba(255, 124, 42, 0.15); color: var(--neon-orange); }

.badge-low { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.badge-medium { background: rgba(0, 212, 255, 0.12); color: var(--neon-blue); }
.badge-high { background: rgba(255, 124, 42, 0.15); color: var(--neon-orange); }
.badge-urgent { background: rgba(255, 45, 120, 0.15); color: var(--neon-pink); }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s;
}

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

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

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

.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

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

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

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(30, 45, 71, 0.5);
  color: var(--text-primary);
}

tr:hover td { background: rgba(0, 212, 255, 0.03); }
tr:last-child td { border-bottom: none; }

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-bar {
  height: 6px;
  background: var(--bg-card2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient-main);
  transition: width 0.6s ease;
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-card);
}

.toast.success { border-color: rgba(0, 255, 136, 0.4); }
.toast.error { border-color: rgba(255, 45, 120, 0.4); }
.toast.info { border-color: rgba(0, 212, 255, 0.4); }

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

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; margin-bottom: 8px; color: var(--text-primary); }
.empty-state p { font-size: 13px; }

/* =============================================
   LOADING
   ============================================= */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--neon-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* =============================================
   GLOW EFFECTS
   ============================================= */
.glow-blue { box-shadow: 0 0 20px rgba(0, 212, 255, 0.2); }
.glow-purple { box-shadow: 0 0 20px rgba(179, 71, 234, 0.2); }
.glow-green { box-shadow: 0 0 20px rgba(0, 255, 136, 0.2); }
.glow-pink { box-shadow: 0 0 20px rgba(255, 45, 120, 0.2); }

.neon-text-blue { color: var(--neon-blue); }
.neon-text-green { color: var(--neon-green); }
.neon-text-pink { color: var(--neon-pink); }
.neon-text-purple { color: var(--neon-purple); }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-3 { margin-top: 16px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-secondary); }
.text-right { text-align: right; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }

/* =============================================
   SIDEBAR MOBILE TOGGLE
   ============================================= */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
}

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