/* ===== School Payment System - Complete Styles ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body, .sps-wrap { direction: rtl; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; font-size: 14px; }

/* ===== LOGIN PAGE ===== */
.sps-login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #f0f2f5;
}
.sps-login-box {
  width: 420px; background: #fff;
  border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 36px 32px; text-align: center;
}
.sps-login-logo { margin-bottom: 12px; }
.sps-login-logo img { max-width: 260px; height: auto; }
.sps-login-logo .sps-logo-emoji { font-size: 52px; display: block; }
.sps-login-title { font-size: 22px; font-weight: 700; color: #1a2744; margin: 12px 0 4px; }
.sps-login-welcome {
  background: #e8a020; color: #fff;
  border-radius: 6px; padding: 9px 14px;
  font-size: 13px; line-height: 1.6; margin-bottom: 22px;
}
.sps-login-field { position: relative; margin-bottom: 14px; }
.sps-login-field input {
  width: 100%; padding: 11px 16px 11px 42px;
  border: 1.5px solid #dde0e7; border-radius: 8px;
  font-size: 14px; direction: rtl; outline: none;
  transition: border-color 0.2s; background: #fff;
  font-family: inherit;
}
.sps-login-field input:focus { border-color: #1a2744; }
.sps-login-field .sps-field-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #aaa; font-size: 16px; pointer-events: none;
}
.sps-remember-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; font-size: 13px;
}
.sps-remember-label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: #555; }
.sps-remember-label input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.sps-forgot-link { color: #1a2744; text-decoration: none; font-size: 13px; }
.sps-forgot-link:hover { text-decoration: underline; }
.sps-login-btn {
  width: 100%; padding: 12px; background: #e8a020; color: #fff;
  border: none; border-radius: 8px; font-size: 16px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background 0.2s;
  margin-bottom: 18px;
}
.sps-login-btn:hover { background: #d4921a; }
.sps-login-btn:disabled { background: #ccc; cursor: not-allowed; }
.sps-login-divider { color: #aaa; font-size: 13px; margin-bottom: 10px; }
.sps-register-link { color: #1a2744; text-decoration: none; font-size: 13px; font-weight: 600; }
.sps-register-link:hover { text-decoration: underline; }
.sps-admin-link { display: block; margin-top: 14px; color: #999; font-size: 12px; }

/* ===== APP LAYOUT ===== */
.sps-wrap { display: block; }
.sps-app {
  display: flex; min-height: 100vh;
  background: #f0f2f5;
}

/* ===== SIDEBAR ===== */
.sps-sidebar {
  width: 220px; background: #1a2744; color: #fff;
  flex-shrink: 0; position: relative;
  display: flex; flex-direction: column;
}
.sps-sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
}
.sps-sidebar-logo img { max-width: 140px; height: auto; filter: brightness(0) invert(1); }
.sps-sidebar-logo .sps-logo-text {
  font-size: 11px; color: #a0b4d0; line-height: 1.4;
}
.sps-sidebar-toggle {
  color: #a0b4d0; cursor: pointer; font-size: 20px;
  background: none; border: none; padding: 0;
}

/* Nav sections */
.sps-nav { flex: 1; padding: 8px 0; }
.sps-nav-section { margin-bottom: 4px; }
.sps-nav-section-header {
  padding: 10px 16px 6px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.sps-nav-section-label { font-size: 13px; color: #d0d8e8; display: flex; align-items: center; gap: 8px; }
.sps-nav-section-label .sps-nav-icon { font-size: 15px; }
.sps-nav-section-arrow { color: #a0b4d0; font-size: 11px; transition: transform 0.2s; }
.sps-nav-section.open .sps-nav-section-arrow { transform: rotate(180deg); }
.sps-nav-sub { padding: 0; }
.sps-nav-sub-item {
  padding: 9px 16px 9px 24px;
  font-size: 13px; color: #a0b4d0; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background 0.15s;
}
.sps-nav-sub-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sps-nav-sub-item.active { background: rgba(255,255,255,0.12); color: #fff; }
.sps-nav-sub-item .sps-nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #a0b4d0; flex-shrink: 0; }
.sps-nav-sub-item.active .sps-nav-dot { background: #4fc3f7; }

/* Account link at bottom */
.sps-nav-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 10px 0;
}
.sps-nav-bottom-item {
  padding: 9px 16px;
  font-size: 13px; color: #a0b4d0; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.sps-nav-bottom-item:hover { color: #fff; }
.sps-nav-bottom-item .sps-nav-icon { font-size: 15px; }

/* Sidebar collapsed toggle */
.sps-sidebar-collapse-btn {
  position: absolute; top: 50%; left: -12px;
  transform: translateY(-50%);
  width: 24px; height: 24px; background: #1a2744;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff; font-size: 11px; border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ===== MAIN CONTENT ===== */
.sps-main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
}
.sps-topbar {
  background: #fff; padding: 0 20px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #eee; flex-shrink: 0;
}
.sps-topbar-left { display: flex; align-items: center; gap: 12px; }
.sps-topbar-icon { font-size: 18px; color: #888; cursor: pointer; }
.sps-topbar-right { display: flex; align-items: center; gap: 12px; }

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

.sps-page { display: none; }
.sps-page.active { display: block; }
.sps-page-title {
  font-size: 20px; font-weight: 700; color: #1a2744;
  margin-bottom: 20px; text-align: right;
}

/* ===== CARD ===== */
.sps-card {
  background: #fff; border-radius: 10px;
  padding: 0; margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
}
.sps-card-body { padding: 16px 20px; }

/* ===== TABLE (matches screenshot exactly) ===== */
.sps-table-wrap { overflow-x: auto; }
.sps-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sps-table thead tr { border-bottom: 1.5px solid #e8ecf0; }
.sps-table th {
  padding: 13px 16px; text-align: right;
  color: #555; font-weight: 600; font-size: 13px;
  white-space: nowrap; background: #fff;
}
.sps-table td {
  padding: 13px 16px; text-align: right;
  border-bottom: 1px solid #f0f2f5; color: #222;
  vertical-align: middle;
}
.sps-table tbody tr:last-child td { border-bottom: none; }
.sps-table tbody tr:hover td { background: #fafbfc; }

/* Action buttons - blue like screenshot */
.sps-action-btns { display: flex; gap: 6px; }
.sps-action-btn {
  width: 34px; height: 34px; border-radius: 6px;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: opacity 0.15s;
}
.sps-action-btn:hover { opacity: 0.85; }
.sps-action-btn-cart { background: #1976d2; color: #fff; }
.sps-action-btn-eye  { background: #1976d2; color: #fff; }

/* ===== BALANCE BOX ===== */
.sps-balance-box {
  background: #fff; border-radius: 10px; padding: 20px 24px;
  margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sps-balance-label { font-size: 13px; color: #888; margin-bottom: 4px; text-align: right; }
.sps-balance-amount { font-size: 30px; font-weight: 700; color: #1a2744; text-align: right; }
.sps-balance-school { font-size: 12px; color: #aaa; margin-top: 3px; text-align: right; }
.sps-pay-now-btn {
  background: #1976d2; color: #fff; border: none;
  padding: 10px 24px; border-radius: 8px; font-size: 14px;
  cursor: pointer; font-family: inherit; margin-top: 12px;
}

/* ===== FORMS ===== */
.sps-form-group { margin-bottom: 14px; }
.sps-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sps-label { display: block; font-size: 12px; color: #666; margin-bottom: 5px; }
.sps-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid #dde0e7; border-radius: 8px;
  font-size: 13px; font-family: inherit; direction: rtl;
  outline: none; transition: border-color 0.2s;
}
.sps-input:focus { border-color: #1a2744; }

/* ===== BUTTONS ===== */
.sps-btn {
  padding: 8px 18px; border-radius: 8px;
  border: 1.5px solid #dde0e7; background: #fff;
  cursor: pointer; font-size: 13px; color: #333;
  transition: all 0.15s; font-family: inherit;
}
.sps-btn:hover { background: #f5f5f5; }
.sps-btn-primary { background: #1976d2; color: #fff; border-color: #1976d2; }
.sps-btn-primary:hover { background: #1565c0; }
.sps-btn-orange { background: #e8a020; color: #fff; border-color: #e8a020; }
.sps-btn-orange:hover { background: #d4921a; }
.sps-btn-sm { padding: 6px 12px; font-size: 12px; }
.sps-back-btn {
  background: #e8f1fb; color: #1565c0;
  border: none; padding: 8px 16px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-family: inherit;
}

/* ===== ALERTS ===== */
.sps-alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.sps-alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.sps-alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ===== STATS ===== */
.sps-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.sps-stat-card {
  background: #fff; border-radius: 10px; padding: 18px;
  text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sps-stat-label { font-size: 12px; color: #888; margin-bottom: 6px; }
.sps-stat-value { font-size: 24px; font-weight: 700; color: #1a2744; }
.sps-stat-value.green  { color: #16a34a; }
.sps-stat-value.orange { color: #e8a020; }

/* ===== BADGE ===== */
.sps-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.sps-badge-paid    { background: #dcfce7; color: #166534; }
.sps-badge-pending { background: #fef9c3; color: #854d0e; }

/* ===== MODAL ===== */
.sps-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.sps-modal {
  background: #fff; border-radius: 12px; padding: 26px;
  width: 480px; max-width: 95vw;
}
.sps-modal-title { font-size: 16px; font-weight: 700; margin-bottom: 18px; color: #1a2744; }
.sps-modal-footer { display: flex; gap: 8px; margin-top: 18px; }

/* ===== SECTION HEADER ===== */
.sps-section-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 16px;
}

/* ===== LOADING ===== */
.sps-loading { text-align: center; padding: 32px; color: #aaa; font-size: 14px; }

/* ===== FOOTER ===== */
.sps-footer {
  text-align: center; padding: 16px;
  font-size: 12px; color: #aaa;
  border-top: 1px solid #eee; background: #fff;
  margin-top: auto;
}

/* ===== PROFILE ===== */
.sps-profile { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.sps-avatar {
  width: 52px; height: 52px; background: #e8f1fb;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 24px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sps-app { flex-direction: column; }
  .sps-sidebar { width: 100%; }
  .sps-stats-grid { grid-template-columns: 1fr 1fr; }
  .sps-form-row { grid-template-columns: 1fr; }
  .sps-login-box { width: 95%; padding: 24px 16px; }
}
