/* Sanad Marketer CRM Luxury Styles */
:root {
  --crm-green-deep: #031812;
  --crm-green: #0C4A38;
  --crm-green-bright: #1E7A5C;
  --crm-gold: #C6A15B;
  --crm-gold-bright: #E0C384;
}

.sanad-crm-wrap {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  margin: 20px 20px 40px 0;
  color: #1e293b;
}

.sanad-crm-header {
  background: linear-gradient(135deg, #031812 0%, #0C4A38 100%);
  padding: 26px 30px;
  border-radius: 18px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(198, 161, 91, 0.35);
  box-shadow: 0 10px 30px rgba(3, 24, 18, 0.15);
  margin-bottom: 24px;
}

.sanad-crm-header h1 {
  font-family: 'Tajawal', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  margin: 0 0 6px 0;
}

.sanad-crm-header p {
  color: rgba(250, 248, 243, 0.8);
  font-size: 13.5px;
  margin: 0;
}

/* KPI Cards */
.sanad-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

@media(max-width: 1024px) {
  .sanad-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.sanad-kpi-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.sanad-kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.sanad-kpi-icon.blue { background: #E0F2FE; }
.sanad-kpi-icon.green { background: #DCFCE7; }
.sanad-kpi-icon.gold { background: #FEF3C7; }
.sanad-kpi-icon.purple { background: #F3E8FF; }

.sanad-kpi-info h3 {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 4px 0;
  font-weight: 700;
}

.sanad-kpi-val {
  font-family: 'Tajawal', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #031812;
  line-height: 1.1;
}

.sanad-kpi-info small {
  color: #94a3b8;
  font-size: 11.5px;
}

/* Panel Card */
.sanad-panel-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.sanad-panel-card h2 {
  font-family: 'Tajawal', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #031812;
}

/* Status Pill Grid */
.sanad-status-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.sanad-status-summary-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-right: 4px solid #0C4A38;
  padding: 12px 14px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sanad-status-summary-item span {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}

.sanad-status-summary-item b {
  font-size: 20px;
  font-family: 'Tajawal', sans-serif;
}

/* Tables */
.sanad-crm-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13px;
}

.sanad-crm-table th {
  background: #f8fafc;
  padding: 13px 14px;
  color: #475569;
  font-weight: 800;
  border-bottom: 2px solid #e2e8f0;
}

.sanad-crm-table td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.sanad-code-badge {
  background: #f1f5f9;
  color: #0C4A38;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-weight: bold;
}

.sanad-marketer-pill {
  background: #FEF3C7;
  color: #92400E;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}

.sanad-conv-pill {
  background: #DCFCE7;
  color: #15803D;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 12px;
}

.sanad-status-select {
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
}

.sanad-status-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}

/* Link Box */
.sanad-link-box {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sanad-link-box input {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #334155;
  width: 240px;
  direction: ltr;
}

.sanad-link-box button {
  background: #0C4A38;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
}

.sanad-link-box button:hover {
  background: #1E7A5C;
}

/* Buttons */
.sanad-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  font-family: inherit;
  transition: all .2s;
}

.sanad-btn-primary { background: #0C4A38; color: #fff; }
.sanad-btn-primary:hover { background: #1E7A5C; }

.sanad-btn-gold { background: linear-gradient(135deg, #E0C384, #C6A15B); color: #031812; }
.sanad-btn-gold:hover { transform: translateY(-1px); }

.sanad-btn-outline { background: #fff; border-color: #cbd5e1; color: #475569; }
.sanad-btn-outline:hover { background: #f8fafc; color: #0C4A38; }

.sanad-btn-sm { padding: 5px 10px; font-size: 12px; }

.sanad-btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #25D366;
  color: #fff !important;
  font-size: 12px;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
}

.sanad-btn-wa:hover { opacity: 0.9; }

/* Filter Bar */
.sanad-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}

.sanad-filter-bar input, .sanad-filter-bar select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
}

/* Notes */
.sanad-notes-cell {
  max-width: 220px;
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 4px;
}

.sanad-edit-notes-btn {
  background: none;
  border: none;
  color: #0C4A38;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* Modal */
.sanad-crm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.sanad-crm-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.sanad-crm-modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

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

.sanad-pagination a {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-decoration: none;
  color: #475569;
  font-size: 13px;
  font-weight: bold;
}

.sanad-pagination a.active {
  background: #0C4A38;
  color: #fff;
  border-color: #0C4A38;
}

/* ====================================================================
   FRONT-END PORTAL STYLING
   ==================================================================== */
.sanad-portal-login-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 15px;
  font-family: 'Tajawal', 'Cairo', sans-serif;
}

.sanad-portal-login-card {
  background: #fff;
  border: 1px solid rgba(198, 161, 91, 0.35);
  border-radius: 20px;
  padding: 36px 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(12, 74, 56, 0.1);
  text-align: right;
}

.sanad-portal-brand {
  text-align: center;
  margin-bottom: 24px;
}

.sanad-portal-brand img {
  width: 70px;
  height: 70px;
  margin-bottom: 10px;
}

.sanad-portal-brand h2 {
  font-size: 22px;
  font-weight: 900;
  color: #0C4A38;
  margin: 0 0 6px;
}

.sanad-portal-brand p {
  color: #64748b;
  font-size: 13px;
  margin: 0;
}

.sanad-portal-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 18px;
  text-align: center;
}

.sanad-portal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sanad-form-field label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 6px;
}

.sanad-form-field input {
  width: 100%;
  border: 1.5px solid rgba(12, 74, 56, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  box-sizing: border-box;
}

.sanad-portal-submit-btn {
  background: linear-gradient(135deg, #0C4A38, #1E7A5C);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 6px 18px rgba(12, 74, 56, 0.25);
}

/* Front-end Dashboard */
.sanad-portal-wrap {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  direction: rtl;
  text-align: right;
}

.sanad-portal-header {
  background: linear-gradient(135deg, #031812 0%, #0C4A38 100%);
  padding: 24px 28px;
  border-radius: 18px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(198, 161, 91, 0.35);
  box-shadow: 0 10px 30px rgba(12, 74, 56, 0.15);
  margin-bottom: 24px;
}

.sanad-portal-header h2 {
  font-size: 22px;
  font-weight: 900;
  color: #E0C384;
  margin: 0 0 4px;
}

.sanad-portal-header p {
  color: rgba(250, 248, 243, 0.8);
  font-size: 13.5px;
  margin: 0;
}

.sanad-btn-logout {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
}

.sanad-portal-card {
  background: #fff;
  border: 1px solid rgba(12, 74, 56, 0.12);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.sanad-link-hero-card {
  background: linear-gradient(135deg, #FAF8F3 0%, #F5F1E6 100%);
  border: 2px solid #C6A15B;
}

.sanad-hero-link-box {
  display: flex;
  gap: 8px;
}

.sanad-hero-link-box input {
  flex: 1;
  background: #fff;
  border: 1.5px solid #C6A15B;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: bold;
  color: #0C4A38;
  direction: ltr;
}

.sanad-hero-link-box button {
  background: linear-gradient(135deg, #C6A15B, #E0C384);
  color: #031812;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.sanad-portal-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

@media(max-width: 650px) {
  .sanad-portal-stats-grid { grid-template-columns: 1fr; }
  .sanad-hero-link-box { flex-direction: column; }
}

.sanad-portal-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.sanad-portal-stat-card span {
  display: block;
  font-size: 12.5px;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 6px;
}

.sanad-portal-stat-card b {
  display: block;
  font-size: 28px;
  font-family: 'Tajawal', sans-serif;
  margin-bottom: 2px;
}

.sanad-portal-stat-card small {
  color: #94a3b8;
  font-size: 11px;
}
