:root {
  --navy: #1B2A4A;
  --gold: #C5A044;
  --gold-light: #D4B363;
  --cream: #F9F6F0;
  --white: #FFFFFF;
  --text-dark: #333333;
  --text-light: #666666;
  --border: #E0DCD3;
  --danger: #e74c3c;
  --success: #2ecc71;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

body {
  background-color: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
}

h1, h2, h3 { color: var(--navy); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 8px; font-weight: 700;
  cursor: pointer; border: none; transition: var(--transition);
  font-size: 1rem;
}
.btn-sm { padding: 5px 10px; font-size: 0.85rem; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--gold); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }

/* Badge */
.badge { padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; }
.badge-success { background: #d4edda; color: #155724; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 700; color: var(--navy); font-size: 0.95rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 1rem; background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(197,160,68,.2);
}
.form-group small { display: block; color: var(--text-light); margin-top: 5px; font-size: 0.8rem; }
.form-group input[type="file"] { padding: 8px 12px; background: #fdfdfb; border: 2px dashed var(--border); cursor: pointer; font-size: 0.9rem; }
.row { display: flex; gap: 15px; }
.col { flex: 1; }

/* Login Screen */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: var(--white); padding: 40px; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.08); width: 100%; max-width: 400px; text-align: center; }
.login-logo { width: 80px; margin-bottom: 20px; }
.login-box .btn { width: 100%; margin-top: 10px; }

/* Dashboard Header */
.admin-header { background: var(--white); border-bottom: 1px solid var(--border); padding: 15px 0; position: sticky; top: 0; z-index: 10; }
.header-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 15px; }
.brand img { width: 40px; }
.brand h1 { font-size: 1.5rem; margin: 0; }
.header-actions { display: flex; align-items: center; gap: 15px; }

/* Main Area */
.admin-main { max-width: 1200px; margin: 30px auto; padding: 0 20px; }

/* Tabs */
.tabs-nav { display: flex; gap: 10px; margin-bottom: 30px; border-bottom: 2px solid var(--border); overflow-x: auto; padding-bottom: 5px; }
.tab-btn { background: none; border: none; padding: 10px 20px; font-size: 1rem; font-weight: bold; color: var(--text-light); cursor: pointer; transition: var(--transition); border-bottom: 3px solid transparent; margin-bottom: -7px; white-space: nowrap; }
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Cards & Lists */
.card { background: var(--white); padding: 25px; border-radius: 12px; border: 1px solid var(--border); transition: var(--transition); }
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.mt-20 { margin-top: 20px; }
.card h3 { margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.card-subtitle { color: var(--text-light); font-size: .9rem; margin-bottom: 15px; }
.card-header { margin-bottom: 20px; }
.actions-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.grid-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.list-item { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 15px; transition: var(--transition); height: 100%; justify-content: space-between; }
.list-item:hover { border-color: var(--gold); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.list-info { flex: 1; }
.list-meta { color: var(--text-light); font-size: 0.9rem; margin-top: 5px; }
.list-actions { display: flex; gap: 10px; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(27,42,74,0.8); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: var(--transition); z-index: 1000; padding: 20px; overflow-y: auto; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-box { background: var(--white); width: 100%; max-width: 600px; border-radius: 16px; padding: 30px; transform: translateY(20px); transition: var(--transition); margin: auto; }
.modal-overlay.active .modal-box { transform: translateY(0); }
.modal-box h3 { margin-bottom: 25px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 15px; margin-top: 30px; }

/* Status Msgs */
.error-msg { color: var(--danger); margin-top: 15px; font-size: .9rem; display: none; }
.status-msg { padding: 15px; border-radius: 8px; margin-bottom: 20px; font-weight: bold; text-align: center; display: none; }
.status-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Checkbox Grid */
.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; background: #fcfbf8; padding: 15px; border-radius: 8px; border: 1px solid var(--border); }
.day-check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.day-check input { width: 18px; height: 18px; cursor: pointer; }

/* Responsive */
@media (max-width: 768px) {
  .row { flex-direction: column; gap: 0; }
  .grid-list { grid-template-columns: 1fr; }
  .list-item { flex-direction: column; align-items: flex-start; }
  .list-actions { margin-top: 15px; width: 100%; justify-content: flex-end; }
  .actions-bar { flex-direction: column; align-items: stretch; gap: 15px; }
  .tabs-nav { padding-bottom: 10px; gap: 5px; }
  .tab-btn { padding: 8px 14px; font-size: .85rem; }
  .header-content { flex-direction: column; gap: 12px; text-align: center; }
  .header-actions { flex-wrap: wrap; justify-content: center; }
  .brand h1 { font-size: 1.2rem; }
  .admin-main { margin: 15px auto; padding: 0 12px; }
  .card { padding: 16px; }
  .modal-box { padding: 20px; max-width: 95vw; }
  .card-subtitle { font-size: .85rem; }
}

/* Gateway Select Screen */
.gateway-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background-color: var(--cream);
}
.gateway-box {
  background: var(--white);
  padding: 50px 40px;
  border-radius: 20px;
  box-shadow: 0 15px 50px rgba(27, 42, 74, 0.08);
  width: 100%;
  max-width: 900px;
  text-align: center;
  border: 1px solid var(--border);
}
.gateway-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  margin-bottom: 20px;
}
.gateway-box h2 {
  font-size: 1.8rem;
  color: var(--navy);
  margin-bottom: 8px;
  font-weight: 800;
}
.gateway-subtitle {
  color: var(--text-light);
  font-size: 1.05rem;
  margin-bottom: 40px;
}
.gateway-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-bottom: 20px;
}
.gateway-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 35px 25px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.gateway-card:hover {
  border-color: var(--gold);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(197, 160, 68, 0.12);
}
.gateway-card-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}
.gateway-card h3 {
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 12px;
  font-weight: 700;
}
.gateway-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 25px;
  min-height: 4.5em;
}
.gateway-card .btn {
  width: 100%;
}
@media (max-width: 768px) {
  .gateway-options {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .gateway-box {
    padding: 30px 20px;
  }
  .gateway-card {
    padding: 25px 15px;
  }
}

