/* ==========================================================================
   Slash Web (slashweb.net.eg) - Modern Admin & Client Portal CSS (v2.1.0)
   Ultra Responsive Dark SaaS Design System (RTL / Cairo Typography)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Brand Theme Colors */
  --adm-bg: #080d1a;
  --adm-sidebar: #0e1526;
  --adm-sidebar-hover: #152038;
  --adm-card: #111a2e;
  --adm-card-hover: #16223c;
  --adm-input-bg: #0b1220;
  --adm-input-border: rgba(255, 255, 255, 0.09);
  --adm-input-focus: #3b82f6;
  
  --adm-border: rgba(255, 255, 255, 0.08);
  --adm-border-light: rgba(255, 255, 255, 0.04);
  --adm-border-glow: rgba(59, 130, 246, 0.35);

  --adm-primary: #2563eb;
  --adm-primary-hover: #1d4ed8;
  --adm-accent: #06b6d4;
  --adm-accent-hover: #0891b2;
  --adm-success: #10b981;
  --adm-warning: #f59e0b;
  --adm-danger: #ef4444;
  --adm-purple: #8b5cf6;

  /* Typography Colors */
  --adm-text: #f8fafc;
  --adm-text-muted: #94a3b8;
  --adm-text-dim: #64748b;

  /* Dimensions */
  --sidebar-w: 260px;
  --topbar-h: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body.admin-body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--adm-bg);
  color: var(--adm-text);
  line-height: 1.65;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--adm-bg);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Links & Typography */
a {
  color: var(--adm-text);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--adm-accent);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.text-gradient {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Admin Sidebar
   ========================================================================== */
.admin-sidebar {
  width: var(--sidebar-w);
  background-color: var(--adm-sidebar);
  border-left: 1px solid var(--adm-border);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.3);
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  height: var(--topbar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--adm-border);
  background: rgba(14, 21, 38, 0.85);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-brand-name small {
  display: block;
  font-size: 0.72rem;
  color: var(--adm-accent);
  font-weight: 600;
}

.sidebar-menu {
  list-style: none;
  padding: 15px 12px;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 800;
  padding: 14px 10px 4px;
  letter-spacing: 0.5px;
}

.sidebar-item {
  margin-bottom: 3px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--adm-text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  position: relative;
}

.sidebar-link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  color: #64748b;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: var(--adm-sidebar-hover);
  color: #ffffff;
}

.sidebar-link:hover i {
  color: var(--adm-accent);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9) 0%, rgba(99, 102, 241, 0.9) 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.sidebar-link.active i {
  color: #ffffff;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 17, 32, 0.6);
  flex-shrink: 0;
}

/* ==========================================================================
   Admin Main Layout & Topbar
   ========================================================================== */
.admin-main-wrapper {
  margin-right: var(--sidebar-w);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  transition: margin-right 0.3s ease;
}

.admin-topbar {
  height: var(--topbar-h);
  background: rgba(14, 21, 38, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  position: sticky;
  top: 0;
  z-index: 900;
  gap: 15px;
}

.topbar-left-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.admin-topbar-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
}

.admin-user-info {
  text-align: right;
  line-height: 1.2;
}

.admin-user-name {
  font-weight: 800;
  font-size: 0.92rem;
  color: #fff;
  white-space: nowrap;
}

.admin-user-email {
  font-size: 0.75rem;
  color: var(--adm-text-muted);
  white-space: nowrap;
}

.admin-content-body {
  padding: 28px;
  flex-grow: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.admin-mobile-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--adm-border);
  color: #fff;
  font-size: 1.2rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.admin-mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--adm-accent);
}

/* ==========================================================================
   Dashboard Statistics Cards
   ========================================================================== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 25px;
}

.admin-stat-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  transition: var(--transition);
}

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

.stat-info h3 {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 2px;
  color: #fff;
}

.stat-info p {
  font-size: 0.85rem;
  color: var(--adm-text-muted);
  white-space: nowrap;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.stat-icon-blue { background: rgba(37, 99, 235, 0.15); color: #60a5fa; border: 1px solid rgba(37, 99, 235, 0.3); }
.stat-icon-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.stat-icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.stat-icon-purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }

/* ==========================================================================
   Cards & Layouts
   ========================================================================== */
.admin-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 25px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
  position: relative;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--adm-border);
  flex-wrap: wrap;
  gap: 10px;
}

.admin-card-header h3 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Form Controls & Elements
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: #e2e8f0;
  margin-bottom: 8px;
  text-align: right;
}

.form-control {
  width: 100% !important;
  display: block !important;
  padding: 11px 15px;
  background: var(--adm-input-bg) !important;
  border: 1.5px solid var(--adm-input-border) !important;
  border-radius: var(--radius-sm) !important;
  color: #ffffff !important;
  font-family: 'Cairo', sans-serif !important;
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
  transition: var(--transition);
}

.form-control:focus {
  outline: none !important;
  border-color: var(--adm-input-focus) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
  background: #0f182b !important;
}

.form-control::placeholder {
  color: #64748b;
  font-size: 0.9rem;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: left 14px center !important;
  background-size: 16px !important;
  padding-left: 40px !important;
}

select.form-control option {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 10px;
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
  line-height: 1.7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--adm-border);
  color: #e2e8f0;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--adm-accent);
  color: var(--adm-accent);
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.84rem;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  min-width: 600px;
}

.admin-table th {
  padding: 12px 16px;
  font-size: 0.84rem;
  color: #94a3b8;
  border-bottom: 1px solid var(--adm-border);
  font-weight: 700;
  background: rgba(0, 0, 0, 0.15);
}

.admin-table td {
  padding: 13px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--adm-border);
  vertical-align: middle;
}

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

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-new { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-in_review { background: rgba(245, 158, 11, 0.2); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-contacted { background: rgba(14, 165, 233, 0.2); color: #7dd3fc; border: 1px solid rgba(14, 165, 233, 0.3); }
.badge-quoted { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-approved { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-rejected { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-active { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-inactive { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.3); }

/* Action Buttons */
.action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  border: 1px solid var(--adm-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--adm-text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--adm-primary);
  color: #fff;
  border-color: var(--adm-primary);
  transform: translateY(-1px);
}

.btn-icon-danger:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

/* Flash Alerts */
.alert {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #34d399; }
.alert-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #f87171; }
.alert-info { background: rgba(37, 99, 235, 0.15); border: 1px solid rgba(37, 99, 235, 0.3); color: #60a5fa; }

/* Admin Dashboard Responsive Grid */
.admin-dashboard-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 25px;
  align-items: start;
}

/* Close Button for Sidebar */
.sidebar-close-btn {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.sidebar-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
}

/* ==========================================================================
   Responsive Breakpoints for Admin & Client Panels
   ========================================================================== */
@media (max-width: 992px) {
  .sidebar-close-btn {
    display: inline-flex;
  }

  .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 290px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    transform: translateX(100%) !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s !important;
    z-index: 2000 !important;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.95) !important;
  }

  .admin-sidebar.open {
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .admin-main-wrapper {
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .admin-mobile-toggle {
    display: inline-flex !important;
  }

  .admin-topbar {
    padding: 0 15px !important;
  }

  .admin-content-body {
    padding: 18px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .admin-user-info {
    display: none !important;
  }

  .admin-dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

@media (max-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .admin-stat-card {
    padding: 14px 12px !important;
  }
  .stat-info h3 {
    font-size: 1.45rem !important;
  }
  .stat-info p {
    font-size: 0.78rem !important;
  }
  .stat-icon-wrapper {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.15rem !important;
  }
  .admin-card {
    padding: 16px 12px !important;
  }
}

@media (max-width: 520px) {
  .topbar-btn-site span {
    display: none;
  }
  .admin-topbar-title {
    font-size: 0.98rem;
  }
}
