/* خطوط Google Fonts عربية حديثة */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap');

:root {
  --main: #1e88e5;
  --main-dark: #1565c0;
  --accent: #ffb300;
  --bg: #f7f9fa;
  --text: #222;
  --radius: 18px;
}

html, body {
  font-family: 'Cairo', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.container {
  width: 95%;
  max-width: 1100px;
  margin: auto;
}

.main-header {
  background: #fff;
  box-shadow: 0 2px 8px #0001;
  padding: 0.5rem 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.logo {
  height: 48px;
  vertical-align: middle;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav a {
  color: var(--main-dark);
  text-decoration: none;
  margin: 0 1rem;
  font-weight: 700;
  transition: color 0.2s;
}

nav a.active, nav a:hover {
  color: var(--accent);
}

.hero-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  background: linear-gradient(120deg, #e3f2fd 0%, #fff 100%);
  border-radius: var(--radius);
  margin-top: 2rem;
}

.hero-section h1 {
  font-size: 2.8rem;
  color: var(--main-dark);
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.3rem;
  color: #555;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
}

.main-btn {
  background: var(--main);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px #0002;
}

.main-btn.alt {
  background: var(--accent);
  color: var(--main-dark);
}

.main-btn.disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
}

footer {
  background: #fff;
  text-align: center;
  padding: 1rem 0;
  margin-top: 3rem;
  border-top: 1px solid #eee;
  font-size: 1rem;
  color: #888;
}

/* تصميم استمارات عصري */
.form-section {
  min-height: 80vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 0 3rem 0;
}
.styled-form {
  background: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  max-width: 100%;
  margin: 0;
}
.form-group {
  margin-bottom: 1.3rem;
}
.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--main-dark);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-size: 1.1rem;
  background: #f7f9fa;
  transition: border 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--main);
  outline: none;
}
.radio-group {
  display: flex;
  gap: 2rem;
  margin-top: 0.5rem;
}
.radio-group label {
  font-weight: 500;
  color: #444;
}
.required {
  color: #e53935;
  font-size: 1.1em;
}
.main-btn[type="submit"] {
  width: 100%;
  margin-top: 1.5rem;
  font-size: 1.2rem;
}
@media (min-width: 600px) {
  .hero-actions {
    flex-direction: row;
    gap: 2rem;
    justify-content: center;
  }
  nav {
    float: none;
    display: inline-block;
    margin-right: 2rem;
  }
}
@media (max-width: 600px) {
  .styled-form {
    padding: 1.2rem 0.5rem 1rem 0.5rem;
  }
}

/* لوحة تحكم الأدمن */
.admin-dashboard-section {
  padding: 2rem 0;
  min-height: calc(100vh - 140px);
  background: #f5f7fa;
}
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.stat-card {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-card.clickable {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}
.stat-card.clickable:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, var(--main) 0%, var(--main-dark) 100%);
  color: white;
}
.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}
.stat-card h2 {
  font-size: 2.5rem;
  margin: 0.5rem 0;
  font-weight: 700;
}
.stat-card span {
  display: block;
  font-size: 1.1rem;
  color: inherit;
  opacity: 0.8;
}
.stat-note {
  display: block;
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.6;
}

/* إجراءات سريعة */
.quick-actions {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-top: 2rem;
}
.quick-actions h3 {
  margin: 0 0 1.5rem 0;
  color: var(--main-dark);
}
.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.action-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}
.action-card:hover {
  background: var(--main);
  color: white;
  transform: translateY(-2px);
}
.action-icon {
  font-size: 1.5rem;
  opacity: 0.8;
}
.action-text {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .stat-card {
    padding: 1.5rem;
  }
  
  .stat-card h2 {
    font-size: 2rem;
  }
  
  .actions-grid {
    grid-template-columns: 1fr;
  }
}

/* صفحة تسجيل الدخول */
.login-section {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, #e3f2fd 0%, #fff 100%);
}
.login-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 16px #0002;
  padding: 2.5rem 2rem 2rem 2rem;
  max-width: 370px;
  margin: auto;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-card form {
  width: 100%;
  margin: 0;
}
.login-card .form-group {
  width: 100%;
  margin-bottom: 1.2rem;
}
.login-card input[type="email"],
.login-card input[type="password"] {
  width: 100%;
  box-sizing: border-box;
}
.login-card .main-btn {
  width: 100%;
  font-size: 1.1rem;
  margin-top: 1.2rem;
}
@media (max-width: 600px) {
  .login-card {
    padding: 1.2rem 0.5rem 1rem 0.5rem;
  }
}

/* صفحة المطابقة الذكية */
.matcher-section {
  padding: 2rem 0 3rem 0;
}

.matches-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.match-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 3px 15px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.match-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.match-header {
  background: linear-gradient(120deg, var(--main) 0%, var(--main-dark) 100%);
  color: #fff;
  padding: 1.2rem;
  text-align: center;
}

.match-header h3 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

.match-details {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.buyer-details, .seller-details {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.2rem;
}

.buyer-details h4, .seller-details h4 {
  color: var(--main-dark);
  margin: 0 0 1.2rem 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--main);
  padding-bottom: 0.5rem;
}

.buyer-details h4::before {
  content: '🔍';
}

.seller-details h4::before {
  content: '🏠';
}

.buyer-details p, .seller-details p {
  margin: 0.8rem 0;
  font-size: 1rem;
  color: #444;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  line-height: 1.5;
}

.buyer-details p span:first-child,
.seller-details p span:first-child {
  color: #666;
  font-weight: 500;
  min-width: 100px;
}

.match-value {
  background: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  color: var(--main-dark);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  flex: 1;
  text-align: center;
  word-break: break-word;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  background: #ffebee;
  border-radius: var(--radius);
  color: #c62828;
}

@media (min-width: 768px) {
  .match-details {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .matches-list {
    grid-template-columns: 1fr;
  }
  
  .match-header h3 {
    font-size: 1.4rem;
  }
  
  .buyer-details p, .seller-details p {
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-start;
  }
  
  .match-value {
    width: 100%;
  }
  
  .buyer-details, .seller-details {
    padding: 1rem;
  }
}

/* صفحة نتائج البحث للمستخدم */
.matcher-user-section {
  padding: 2rem 0 3rem 0;
}

.success-message {
  text-align: center;
  margin-bottom: 3rem;
}

.success-icon {
  width: 80px;
  margin-bottom: 1rem;
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

.reference-box {
  background: linear-gradient(135deg, var(--main) 0%, var(--main-dark) 100%);
  color: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.reference-box h3 {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
}

.reference-number {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: var(--main);
  color: #FFFFFF !important;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  font-family: monospace;
}

/* تنسيق الرقم المرجعي في صفحة matcher-user */
.property-card .reference-number,
.matches-list .reference-number {
  color: #FFFFFF !important;
  background: var(--main);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.reference-note {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
}

.results-stats {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.stat {
  text-align: center;
  background: #fff;
  padding: 1.5rem 3rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--main-dark);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #666;
  font-size: 1.1rem;
}

.benefits-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.benefits-list li {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.benefits-list .icon {
  font-size: 2rem;
  color: var(--main);
}

.benefit-text h3 {
  margin: 0 0 0.5rem 0;
  color: var(--main-dark);
  font-size: 1.1rem;
}

.benefit-text p {
  margin: 0;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.4;
}

.contact-section {
  margin-top: 4rem;
  background: var(--bg);
  padding: 3rem 0;
  border-radius: var(--radius);
}

.why-us {
  text-align: center;
  margin-bottom: 3rem;
}

.why-us h2 {
  color: var(--main-dark);
  margin-bottom: 2rem;
}

.contact-box {
  text-align: center;
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  max-width: 500px;
  margin: 0 auto;
}

.contact-box h2 {
  color: var(--main-dark);
  margin-bottom: 1rem;
}

.contact-note {
  color: #666;
  margin-bottom: 2rem;
}

.phone-numbers {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.phone-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--main);
  color: #fff;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-size: 1.3rem;
  font-weight: 700;
  transition: transform 0.2s, background 0.2s;
}

.phone-link:hover {
  transform: translateY(-2px);
  background: var(--main-dark);
}

.phone-icon {
  font-size: 1.4rem;
}

/* تعديل بطاقات المطابقة للمستخدم */
.matches-list.user-view .match-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 3px 15px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.matches-list.user-view .match-header {
  background: linear-gradient(120deg, var(--main) 0%, var(--main-dark) 100%);
  color: #fff;
  padding: 1.2rem;
  text-align: center;
}

.matches-list.user-view .match-details {
  padding: 1.5rem;
}

.matches-list.user-view .property-info {
  background: var(--bg);
  border-radius: 12px;
  padding: 1.2rem;
}

.matches-list.user-view .property-info h4 {
  color: var(--main-dark);
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--main);
  padding-bottom: 0.5rem;
}

.matches-list.user-view .property-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.matches-list.user-view .feature-tag {
  background: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--main-dark);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .benefits-list {
    grid-template-columns: 1fr;
  }
  
  .phone-numbers {
    flex-direction: column;
  }
  
  .reference-number {
    font-size: 1.5rem;
  }
}

/* تحسين تجاوب صفحة index.html */
@media (max-width: 700px) {
  .container {
    width: 100%;
    padding: 0 8px;
    max-width: 100%;
  }
  .main-header .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    float: none;
    margin: 0;
  }
  .logo {
    height: 38px;
  }
  .hero-section {
    min-height: 50vh;
    margin-top: 1rem;
    border-radius: 0;
    padding: 1.5rem 0.5rem;
    flex-direction: column;
  }
  .hero-section h1 {
    font-size: 2rem;
  }
  .subtitle {
    font-size: 1rem;
    margin-bottom: 1.2rem;
  }
  .main-btn, .main-btn.alt, .main-btn.disabled {
    font-size: 1rem;
    padding: 0.7rem 1.2rem;
  }
  .hero-actions {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  footer {
    font-size: 0.95rem;
    margin-top: 1.5rem;
    padding: 0.7rem 0;
  }
}

@media (max-width: 400px) {
  .hero-section h1 {
    font-size: 1.3rem;
  }
  .main-btn, .main-btn.alt, .main-btn.disabled {
    font-size: 0.9rem;
    padding: 0.5rem 0.7rem;
  }
}

/* ستايل زر تسجيل الخروج */
.logout-btn {
  background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(204, 0, 0, 0.2);
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(204, 0, 0, 0.3);
  background: linear-gradient(135deg, #ff5555 0%, #dd0000 100%);
}

.logout-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(204, 0, 0, 0.2);
}

.logout-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  background: #999;
  box-shadow: none;
}

.logout-icon {
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
  }
  
  nav {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  
  .logout-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
}

/* تنسيق زر النسخ */
.reference-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.copy-btn.copied {
  background: rgba(76, 175, 80, 0.3);
}

.copy-btn .copy-icon {
  font-size: 1.2rem;
}

.copy-btn .copy-text {
  font-weight: 500;
}

/* تحسين شكل الرقم المرجعي */
.reference-number {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

@media (max-width: 480px) {
  .reference-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .copy-btn {
    width: 100%;
    justify-content: center;
  }
}

/* تنسيق صندوق البحث */
.search-box {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  margin: 2rem auto;
  text-align: center;
  max-width: 600px;
}

.search-box h2 {
  color: var(--main-dark);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.reference-search-form {
  max-width: 500px;
  margin: 0 auto;
}

.search-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.search-input-group input {
  flex: 1;
  padding: 0.8rem 1rem;
  border: 2px solid #e3f2fd;
  border-radius: var(--radius);
  font-size: 1.1rem;
  transition: all 0.3s ease;
  text-align: center;
  letter-spacing: 1px;
  font-family: monospace;
  font-weight: 600;
  direction: ltr;
}

.search-input-group input:focus {
  border-color: var(--main);
  outline: none;
  box-shadow: 0 0 0 3px rgba(30,136,229,0.2);
}

/* تنسيقات حالة التحميل */
.search-input-group input:disabled {
  background-color: #f5f5f5;
  cursor: wait;
  color: #999;
}

.search-btn:disabled {
  background: #e0e0e0;
  cursor: wait;
  transform: none;
  opacity: 0.8;
}

.search-btn:disabled .search-icon {
  animation: spin 1.5s linear infinite;
}

.search-btn.error {
  background: #ff5252;
}

.search-btn.success {
  background: #4caf50;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.search-btn {
  background: var(--main);
  color: #fff;
  border: none;
  padding: 0 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: var(--main-dark);
  transform: translateY(-2px);
}

.search-note {
  color: #666;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-family: monospace;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 600px) {
  .search-input-group {
    flex-direction: column;
  }
  
  .search-btn {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
  }
  
  .search-box {
    margin: 1rem;
    padding: 1.5rem 1rem;
  }
}

/* تنسيق البطاقات الإحصائية القابلة للنقر */
.stat-card.clickable {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.stat-card.clickable:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, var(--main) 0%, var(--main-dark) 100%);
  color: white;
}

/* تنسيق جداول القوائم */
.list-section {
  padding: 2rem 0;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.list-stats {
  display: flex;
  gap: 1rem;
}

.list-stats .stat-card {
  background: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-align: center;
}

.list-stats h3 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--main);
}

.list-stats span {
  font-size: 0.9rem;
  color: #666;
}

/* Table Styles */
.table-responsive {
  overflow-x: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-top: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--main);
  color: white;
  padding: 1rem;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid #eee;
}

.data-table tbody tr:hover {
  background: #f8f8f8;
}

.loading-cell, .empty-cell, .error-cell {
  text-align: center;
  padding: 3rem !important;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0,0,0,0.1);
  border-left-color: var(--main);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Button Styles */
.view-btn, .delete-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.view-btn {
  background: var(--main);
  color: white;
  margin-left: 0.5rem;
}

.view-btn:hover {
  background: var(--main-dark);
}

.delete-btn {
  background: #ff4444;
  color: white;
}

.delete-btn:hover {
  background: #cc0000;
}

.delete-btn:disabled,
.view-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Search Filters */
.search-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.filter-input:focus,
.filter-select:focus {
  border-color: var(--main);
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--main-rgb), 0.1);
}

/* الرقم المرجعي في أول عمود بنفس حجم وتنسيق بقية الجدول */
.data-table tbody tr td:first-child {
  color: #222 !important;
  font-family: monospace;
  font-weight: normal;
  direction: ltr;
  background: none;
  border-radius: 0;
  letter-spacing: 0.5px;
  font-size: inherit;
  padding: inherit;
}

/* إذا كان هناك تنسيق خاص في صفحة المطابقة، لا نغيره */
.match-result .reference-number {
  color: #fff !important;
  background: var(--main);
}
