/* ==========================================================================
   ZABATAHA ADMIN DASHBOARD - FULL PAGE STYLES (PURE CSS)
   ========================================================================== */

:root {
  --admin-navy: #0e2f44;
  --admin-navy-dark: #081d2b;
  --admin-red: #db3030;
  --admin-red-hover: #b92b2b;
  --admin-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text: #1e293b;
  --admin-text-muted: #64748b;
  --font-cairo: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-outfit: 'Outfit', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-cairo);
  background-color: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }
input, select, textarea { font-family: inherit; outline: none; }

.font-outfit { font-family: var(--font-outfit); }

/* LOGIN SCREEN */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--admin-navy-dark) 0%, var(--admin-navy) 100%);
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  padding: 36px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.login-logo {
  width: 60px;
  height: 60px;
  background: var(--admin-red);
  color: #ffffff;
  font-size: 28px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: 0 8px 20px rgba(219, 48, 48, 0.3);
}

.login-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--admin-navy);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--admin-text-muted);
  margin-bottom: 24px;
}

.login-form-group {
  margin-bottom: 16px;
  text-align: right;
}

.login-form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--admin-text);
  margin-bottom: 6px;
}

.login-form-group input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.login-form-group input:focus {
  border-color: var(--admin-red);
}

.btn-login-submit {
  width: 100%;
  height: 46px;
  background: var(--admin-red);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  box-shadow: 0 6px 18px rgba(219, 48, 48, 0.3);
  transition: background 0.2s;
}

.btn-login-submit:hover {
  background: var(--admin-red-hover);
}

/* MAIN DASHBOARD LAYOUT */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--admin-navy);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  transition: all 0.3s;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--admin-red);
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.sidebar-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

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

.nav-section-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  padding: 12px 12px 6px 12px;
  letter-spacing: 0.5px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 10px;
  margin-bottom: 4px;
  transition: all 0.2s;
}

.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-link.active {
  background: var(--admin-red);
  box-shadow: 0 4px 12px rgba(219, 48, 48, 0.3);
}

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

.user-profile-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--admin-red);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.user-name { font-size: 12.5px; font-weight: 800; color: #ffffff; }
.user-role { font-size: 10.5px; color: #94a3b8; }

.btn-logout {
  color: #f87171;
  font-size: 16px;
  padding: 4px;
  transition: color 0.2s;
}
.btn-logout:hover { color: #ef4444; }

/* MAIN CONTENT BODY */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-header-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--admin-navy);
}

.page-header-sub {
  font-size: 12.5px;
  color: var(--admin-text-muted);
}

.content-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

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

.stat-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stat-val {
  font-size: 24px;
  font-weight: 900;
  color: var(--admin-navy);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-text-muted);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.red { background: #fef2f2; color: var(--admin-red); }
.stat-icon.navy { background: #f0f9ff; color: var(--admin-navy); }
.stat-icon.green { background: #f0fdf4; color: #16a34a; }
.stat-icon.amber { background: #fffbeb; color: #d97706; }

/* CONTENT CARDS & PANELS */
.panel-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

.panel-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--admin-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* FORM STYLES FOR SETTINGS */
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-text);
  margin-bottom: 6px;
}

.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  font-size: 13.5px;
  transition: border-color 0.2s;
}

.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--admin-red);
}

.form-field .help-text {
  font-size: 11.5px;
  color: var(--admin-text-muted);
  margin-top: 4px;
}

.btn-primary-admin {
  background: var(--admin-red);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(219, 48, 48, 0.3);
  transition: background 0.2s;
}

.btn-primary-admin:hover {
  background: var(--admin-red-hover);
}

/* TABLES */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

table.admin-table th, table.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--admin-border);
  text-align: right;
}

table.admin-table th {
  background: #f8fafc;
  font-weight: 800;
  color: var(--admin-navy);
}

/* BADGES & ACTION BUTTONS */
.badge-status {
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
}
.badge-status.pending { background: #fef3c7; color: #92400e; }
.badge-status.completed { background: #dcfce7; color: #166534; }
.badge-status.cancelled { background: #fee2e2; color: #991b1b; }
.badge-status.active { background: #dcfce7; color: #166534; }

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 0.2s;
}
.btn-icon-action.edit { background: #f0f9ff; color: #0284c7; }
.btn-icon-action.delete { background: #fef2f2; color: #dc2626; }

/* MODALS */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.admin-modal-overlay.active { display: flex; }

.modal-box {
  background: #ffffff;
  border-radius: 18px;
  max-width: 540px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 30px;
  position: relative;
  box-shadow: 0 20px 45px rgba(0,0,0,0.25);
  margin: auto;
  border: 1px solid #e2e8f0;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 16px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* SECTION TOGGLE BUTTONS FOR ADMIN DASHBOARD */
.btn-toggle-flag {
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-toggle-flag.on {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.btn-toggle-flag.off {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.btn-toggle-flag:hover {
  transform: scale(1.05);
}

/* ==========================================================================
   ADMIN DASHBOARD COMPREHENSIVE RESPONSIVE ENGINE
   ========================================================================== */

@media (max-width: 1024px) {
  .dashboard-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    border-left: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 16px;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 8px;
    padding-bottom: 8px;
  }

  .sidebar-link {
    margin-bottom: 0;
    padding: 8px 14px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .main-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

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

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table {
    min-width: 650px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .modal-box {
    max-width: 95%;
    padding: 20px 16px;
  }
}

