/* منصة التواصل - أزرق داكن وذهبي، RTL */
:root {
  --blue-dark: #0d2137;
  --blue-mid: #1a3a52;
  --gold: #c9a227;
  --gold-light: #e5c65c;
  --gold-dark: #9a7b1a;
  --white: #ffffff;
  --gray-light: #e8e8e8;
  --gray-text: #94a3b8;
  --font: 'Tajawal', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--blue-dark);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
}

/* الهيدر */
.header {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.party-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.header-deputy-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--gold);
  margin-top: 0.25rem;
}

.deputy-info {
  display: flex;
  flex-direction: column;
}

.deputy-title {
  font-size: 0.8rem;
  color: var(--gold-light);
  font-weight: 500;
}

.deputy-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

/* أيقونة الثلاث نقاط */
.menu-trigger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 8px;
  cursor: pointer;
  margin-right: auto;
  transition: background 0.2s, border-color 0.2s;
}

.menu-trigger span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  margin: 0 auto;
}

.menu-trigger:hover {
  background: rgba(201, 162, 39, 0.15);
  border-color: var(--gold);
}

.deputy-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}

/* القائمة الجانبية */
.side-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.25s;
}

.side-menu.is-open {
  pointer-events: auto;
  visibility: visible;
}

.side-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.25s;
}

.side-menu.is-open .side-menu-overlay {
  opacity: 1;
}

.side-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: var(--blue-mid);
  box-shadow: -4px 0 20px rgba(0,0,0,0.4);
  padding: 1.5rem;
  transform: translateX(100%);
  transition: transform 0.25s;
}

.side-menu.is-open .side-menu-panel {
  transform: translateX(0);
}

.side-menu-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  line-height: 1;
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 0;
}

.side-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 3rem;
}

.side-menu-link {
  display: block;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--blue-dark);
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
  text-align: center;
  transition: opacity 0.2s, transform 0.2s;
}

.side-menu-link:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* الهيرو */
.hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 55%;
  background-color: var(--blue-mid);
  opacity: 0.25;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--blue-dark) 0%, transparent 40%, var(--blue-dark) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  text-align: center;
}

.hero-photos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.hero-party-logo,
.hero-deputy-photo {
  max-width: 100px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.hero-deputy-photo {
  display: block;
}

.hero-title {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
}

.hero-slogan {
  margin: 0 0 2rem;
  font-size: 1rem;
  color: var(--gray-light);
  font-weight: 500;
}

.service-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 9.5rem;
  margin-bottom: 2rem;
}

.service-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100px;
  padding: 1rem 0.5rem;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(201, 162, 39, 0.5);
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.service-icon:hover {
  background: rgba(201, 162, 39, 0.2);
  border-color: var(--gold);
  transform: scale(1.05);
}

.service-icon-img {
  font-size: 1.75rem;
}

.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--blue-dark);
  border: none;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.4);
  transition: opacity 0.2s, transform 0.2s;
}

.cta-button:hover {
  opacity: 0.95;
  transform: translateY(-2px);
}

/* استعلام عن طلب */
.inquiry-section {
  max-width: 600px;
  margin: 2rem auto 1rem;
  padding: 2rem 1rem;
  background: var(--blue-mid);
  border-radius: 16px;
  border: 1px solid rgba(201, 162, 39, 0.25);
}
.inquiry-title {
  margin: 0 0 1.25rem;
  font-size: 1.2rem;
  text-align: center;
  color: var(--gold-light);
}
.inquiry-form-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.inquiry-label {
  display: block;
  font-size: 0.9rem;
  color: var(--gold-light);
  margin-bottom: 0.35rem;
  width: 100%;
}
.inquiry-input {
  flex: 1;
  min-width: 120px;
  padding: 0.6rem 0.75rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 8px;
  background: rgba(0,0,0,0.2);
  color: var(--white);
}
.inquiry-input:focus {
  outline: none;
  border-color: var(--gold);
}
.inquiry-btn {
  padding: 0.6rem 1.25rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--gold);
  color: var(--blue-dark);
  cursor: pointer;
}
.inquiry-btn:hover {
  background: var(--gold-light);
}
.inquiry-result {
  margin: 0;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  min-height: 1.5em;
}
.inquiry-result.success {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.inquiry-result.error {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* الفوتر */
.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--blue-mid);
  color: var(--gray-text);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

.footer-ayah {
  font-size: 0.95rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* نافذة نموذج الشكوى (مودال) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--blue-mid);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(201, 162, 39, 0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  line-height: 1;
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 0;
}

.modal-title {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  text-align: center;
}

.complaint-form label {
  display: block;
  margin-bottom: 1rem;
}

.complaint-form label span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--gold-light);
}

.complaint-form input,
.complaint-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(0,0,0,0.2);
  color: var(--white);
}

.complaint-form input[type="file"] {
  padding: 0.5rem 0;
}

.form-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--gray-text);
}

.complaint-form input::placeholder,
.complaint-form textarea::placeholder {
  color: var(--gray-text);
}

.complaint-form textarea {
  resize: vertical;
  min-height: 100px;
}

.submit-btn {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--blue-dark);
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.submit-btn:hover {
  opacity: 0.95;
}

.form-message {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  text-align: center;
  min-height: 1.4em;
}

.form-message.success { color: var(--gold-light); }
.form-message.error { color: #f87171; }

/* صفحات تسجيل الدخول والداشبورد */
.page-login {
  min-height: 100vh;
  padding: 2rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.page-dashboard {
  min-height: 100vh;
  padding: 2rem 1rem;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (min-width: 1200px) {
  .page-dashboard {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.page-login h1,
.page-dashboard h1 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  text-align: center;
}

.login-form label,
.dashboard-actions {
  display: block;
  margin-bottom: 1rem;
}

.login-form label span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--gold-light);
}

.login-form input {
  width: 100%;
  max-width: 320px;
  padding: 0.6rem 0.75rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(0,0,0,0.2);
  color: var(--white);
}

.login-form button[type="submit"],
.btn-logout {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--blue-dark);
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
}

.login-form .form-error,
.login-form .form-success {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.dashboard-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.3);
  max-width: 100%;
}

.dashboard-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.dashboard-table th,
.dashboard-table td {
  padding: 0.5rem 0.4rem;
  text-align: right;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-table th:nth-child(1),
.dashboard-table td:nth-child(1) { width: 10%; }
.dashboard-table th:nth-child(2),
.dashboard-table td:nth-child(2) { width: 6%; }
.dashboard-table th:nth-child(3),
.dashboard-table td:nth-child(3) { width: 9%; }
.dashboard-table th:nth-child(4),
.dashboard-table td:nth-child(4) { width: 8%; }
.dashboard-table th:nth-child(5),
.dashboard-table td:nth-child(5) { width: 8%; }
.dashboard-table th:nth-child(6),
.dashboard-table td:nth-child(6) { width: 11%; }
.dashboard-table th:nth-child(7),
.dashboard-table td:nth-child(7) { width: 22%; }
.dashboard-table th:nth-child(8),
.dashboard-table td:nth-child(8) { width: 7%; }
.dashboard-table th:nth-child(9),
.dashboard-table td:nth-child(9) { width: 19%; }

.dashboard-table th {
  background: var(--blue-dark);
  color: var(--gold-light);
  font-weight: 700;
}

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

.dashboard-table .cell-date { white-space: nowrap; }
.dashboard-table .cell-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.cell-complaint-wrap { max-width: 100%; overflow: visible; }
.cell-complaint-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-complaint-text.cell-text-expanded {
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}
.cell-complaint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.btn-cell {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font);
  border-radius: 4px;
  cursor: pointer;
  border: none;
  background: rgba(201, 162, 39, 0.3);
  color: var(--gold-light);
}
.btn-cell:hover { background: rgba(201, 162, 39, 0.5); }
.btn-copy { background: rgba(255,255,255,0.1); color: var(--gray-light); }
.btn-copy:hover { background: rgba(255,255,255,0.2); }

.attachment-link {
  color: var(--gold-light);
  text-decoration: underline;
}
.attachment-link:hover { color: var(--gold); }

.dashboard-table .cell-request-number {
  white-space: nowrap;
  font-weight: 500;
}
.cell-status-wrap {
  min-width: 0;
}
.status-select {
  width: 100%;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  font-family: var(--font);
  font-size: 0.85rem;
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
  color: var(--white);
  cursor: pointer;
}
.status-select:focus {
  outline: none;
  border-color: var(--gold);
}

@media (max-width: 768px) {
  .dashboard-table thead { display: none; }
  .dashboard-table tr {
    display: block;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
  }
  .dashboard-table td {
    display: block;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .dashboard-table td:last-child { border-bottom: none; }
  .dashboard-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--gold-light);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
  }
  .dashboard-table .cell-complaint-wrap { max-width: none; }
  .cell-complaint-actions { flex-direction: row; margin-top: 0.75rem; }
  .btn-cell {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
}

.dashboard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.btn-logout {
  background: rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.btn-logout:hover {
  background: rgba(248, 113, 113, 0.5);
}

.dashboard-loading,
.dashboard-empty {
  text-align: center;
  padding: 2rem;
  color: var(--gray-text);
}

@media (min-width: 768px) {
  .hero-photos { gap: 1.25rem; margin-bottom: 1.25rem; }
  .hero-party-logo,
  .hero-deputy-photo { max-width: 120px; max-height: 120px; }
  .hero-title { font-size: 1.85rem; }
  .hero-slogan { font-size: 1.1rem; }
  .service-icon { width: 110px; }
}
