/* ══════════════════════════════════════════
   Neshy Admin — Custom Dark Theme
   Matches the mobile app's design system
   ══════════════════════════════════════════ */

:root {
  --neshy-bg-primary: #0A0E1A;
  --neshy-bg-secondary: #111827;
  --neshy-bg-tertiary: #1F2937;
  --neshy-surface: rgba(31, 41, 55, 0.5);
  --neshy-surface-border: rgba(75, 85, 99, 0.3);
  --neshy-primary: #06B6D4;
  --neshy-primary-dark: #0891B2;
  --neshy-secondary: #8B5CF6;
  --neshy-accent: #3B82F6;
  --neshy-success: #10B981;
  --neshy-warning: #F59E0B;
  --neshy-danger: #EF4444;
  --neshy-text-primary: #F9FAFB;
  --neshy-text-secondary: #9CA3AF;
  --neshy-text-tertiary: #6B7280;
  --neshy-text-muted: #4B5563;
  --neshy-glow-cyan: rgba(6, 182, 212, 0.15);
  --neshy-glow-purple: rgba(139, 92, 246, 0.15);
}

body {
  background: var(--neshy-bg-primary);
  color: var(--neshy-text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--neshy-bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--neshy-text-muted); border-radius: 3px; }

/* Sidebar */
.sidebar {
  background: var(--neshy-bg-secondary);
  border-right: 1px solid var(--neshy-surface-border);
  width: 260px;
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
}

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

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--neshy-primary), var(--neshy-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sidebar-brand-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--neshy-text-primary);
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--neshy-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--neshy-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--neshy-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--neshy-text-primary);
}

.sidebar-link.active {
  background: var(--neshy-glow-cyan);
  color: var(--neshy-primary);
  font-weight: 600;
}

.sidebar-link .badge {
  margin-left: auto;
  background: var(--neshy-danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

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

/* Main content */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
  padding: 0;
}

.top-bar {
  padding: 20px 32px;
  border-bottom: 1px solid var(--neshy-surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--neshy-bg-primary);
  position: sticky;
  top: 0;
  z-index: 30;
}

.top-bar h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--neshy-text-primary);
}

.page-content {
  padding: 28px 32px;
}

/* Cards */
.card {
  background: var(--neshy-bg-tertiary);
  border: 1px solid var(--neshy-surface-border);
  border-radius: 16px;
  padding: 20px;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: rgba(75, 85, 99, 0.5);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--neshy-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--neshy-text-primary);
}

.card-sub {
  font-size: 13px;
  color: var(--neshy-text-tertiary);
  margin-top: 4px;
}

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}

.kpi-card.kpi-cyan::before { background: var(--neshy-primary); }
.kpi-card.kpi-purple::before { background: var(--neshy-secondary); }
.kpi-card.kpi-green::before { background: var(--neshy-success); }
.kpi-card.kpi-yellow::before { background: var(--neshy-warning); }
.kpi-card.kpi-red::before { background: var(--neshy-danger); }
.kpi-card.kpi-blue::before { background: var(--neshy-accent); }

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--neshy-surface-border);
  background: var(--neshy-bg-tertiary);
}

.neshy-table {
  width: 100%;
  border-collapse: collapse;
}

.neshy-table thead th {
  background: var(--neshy-bg-secondary);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--neshy-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--neshy-surface-border);
}

.neshy-table tbody td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--neshy-text-secondary);
  border-bottom: 1px solid rgba(75, 85, 99, 0.15);
}

.neshy-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

/* Status badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-cyan { background: rgba(6, 182, 212, 0.15); color: var(--neshy-primary); }
.badge-cyan .dot { background: var(--neshy-primary); }

.badge-yellow { background: rgba(245, 158, 11, 0.15); color: var(--neshy-warning); }
.badge-yellow .dot { background: var(--neshy-warning); }

.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--neshy-success); }
.badge-green .dot { background: var(--neshy-success); }

.badge-red { background: rgba(239, 68, 68, 0.15); color: var(--neshy-danger); }
.badge-red .dot { background: var(--neshy-danger); }

.badge-gray { background: rgba(107, 114, 128, 0.15); color: var(--neshy-text-tertiary); }
.badge-gray .dot { background: var(--neshy-text-tertiary); }

/* Forms */
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--neshy-bg-secondary);
  border: 1px solid var(--neshy-surface-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--neshy-text-primary);
  outline: none;
  transition: border-color 0.15s;
}

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

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--neshy-text-muted);
}

.form-select option {
  background: var(--neshy-bg-secondary);
  color: var(--neshy-text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--neshy-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  background: var(--neshy-primary-dark);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
  color: white;
}

.btn-secondary {
  background: var(--neshy-secondary);
  color: white;
}

.btn-secondary:hover {
  opacity: 0.9;
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--neshy-surface-border);
  color: var(--neshy-text-secondary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--neshy-text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  min-width: 160px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--neshy-text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
}

.pagination a:hover {
  background: rgba(255, 255, 255, 0.05);
}

.pagination .current {
  background: var(--neshy-primary);
  color: white;
  font-weight: 600;
}

/* Messages / Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success { background: rgba(16, 185, 129, 0.15); color: var(--neshy-success); border: 1px solid rgba(16, 185, 129, 0.3); }
.alert-error { background: rgba(239, 68, 68, 0.15); color: var(--neshy-danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-info { background: rgba(6, 182, 212, 0.15); color: var(--neshy-primary); border: 1px solid rgba(6, 182, 212, 0.3); }

/* Login page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0A0E1A, #1F2937, #0A0E1A);
}

.login-card {
  background: var(--neshy-bg-secondary);
  border: 1px solid var(--neshy-surface-border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--neshy-primary), var(--neshy-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 20px;
}

/* Detail cards */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.detail-main { display: flex; flex-direction: column; gap: 20px; }
.detail-sidebar { display: flex; flex-direction: column; gap: 16px; }

/* User info in ticket detail */
.user-mini-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--neshy-bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--neshy-surface-border);
}

.user-mini-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--neshy-primary), var(--neshy-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
}
