﻿
  :root {
    --gold: #c9a84c;
    --gold-light: #e8c97e;
    --gold-dark: #8a6b28;
    --green-dark: #0a1f0e;
    --green-mid: #122a16;
    --green-accent: #1a4d24;
    --green-light: #2d7a3a;
    --cream: #f7f0e0;
    --text-dark: #1a1208;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background: var(--green-dark);
    color: var(--cream);
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
    background-image: 
      radial-gradient(ellipse at 10% 20%, rgba(201,168,76,0.08) 0%, transparent 50%),
      radial-gradient(ellipse at 90% 80%, rgba(26,77,36,0.4) 0%, transparent 50%),
      repeating-linear-gradient(
        45deg,
        transparent,
        transparent 40px,
        rgba(201,168,76,0.015) 40px,
        rgba(201,168,76,0.015) 41px
      );
  }

  /* HEADER */
  header {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 50%, #0d2411 100%);
    border-bottom: 2px solid var(--gold);
    padding: 0;
    position: relative;
    overflow: hidden;
  }

  header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
      repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(201,168,76,0.04) 60px, rgba(201,168,76,0.04) 61px),
      repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(201,168,76,0.04) 60px, rgba(201,168,76,0.04) 61px);
  }

  .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
  }

  .header-emblem {
    width: 72px;
    height: 72px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    background: rgba(201,168,76,0.08);
    box-shadow: 0 0 20px rgba(201,168,76,0.3);
    animation: pulse-gold 3s ease-in-out infinite;
  }

  @keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 20px rgba(201,168,76,0.3); }
    50% { box-shadow: 0 0 35px rgba(201,168,76,0.5); }
  }

  .header-text h1 {
    font-family: 'Amiri', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.5px;
    line-height: 1.2;
  }

  .header-text .subtitle {
    font-size: 13px;
    color: rgba(247,240,224,0.6);
    margin-top: 4px;
    font-weight: 300;
  }

  .header-badge {
    margin-right: auto;
    background: rgba(201,168,76,0.12);
    border: 1px solid rgba(201,168,76,0.4);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--gold-light);
    white-space: nowrap;
  }

  /* STATS BAR */
  .stats-bar {
    background: rgba(201,168,76,0.07);
    border-bottom: 1px solid rgba(201,168,76,0.2);
    padding: 12px 0;
  }

  .stats-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    gap: 32px;
    align-items: center;
    flex-wrap: wrap;
  }

  .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(247,240,224,0.7);
  }

  .stat-num {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
  }

  /* CONTROLS */
  .controls {
    max-width: 1200px;
    margin: 28px auto 0;
    padding: 0 32px;
  }

  .search-wrap {
    position: relative;
    margin-bottom: 16px;
  }

  .search-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(201,168,76,0.3);
    border-radius: 12px;
    padding: 14px 52px 14px 20px;
    color: var(--cream);
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    text-align: right;
  }

  .search-input:focus {
    border-color: var(--gold);
    background: rgba(255,255,255,0.09);
  }

  .search-input::placeholder { color: rgba(247,240,224,0.35); }

  .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: rgba(201,168,76,0.6);
    pointer-events: none;
  }

  .filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 8px;
  }

  .filter-label {
    font-size: 12px;
    color: rgba(247,240,224,0.5);
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
  }

  .filter-select {
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(201,168,76,0.25);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--cream);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    text-align: right;
    direction: rtl;
    unicode-bidi: plaintext;
  }

  .filter-select:focus { border-color: var(--gold); }
  .filter-select option {
    background: #1a3d20;
    color: var(--cream);
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
    font-family: 'Cairo', sans-serif;
  }

  .clear-btn {
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--gold-light);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }

  .clear-btn:hover { background: rgba(201,168,76,0.2); }

  .results-count {
    font-size: 12px;
    color: rgba(247,240,224,0.45);
    margin-top: 6px;
    margin-bottom: 20px;
  }

  .results-count span { color: var(--gold); font-weight: 600; }

  /* TABLE */
  .table-wrap {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 32px;
    overflow-x: auto;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
  }

  thead th {
    background: var(--green-accent);
    color: var(--gold-light);
    font-weight: 700;
    padding: 13px 14px;
    text-align: right;
    border-bottom: 2px solid var(--gold-dark);
    white-space: nowrap;
    font-size: 13px;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  thead th:first-child { border-radius: 0 8px 0 0; }
  thead th:last-child { border-radius: 8px 0 0 0; }

  tbody tr {
    border-bottom: 1px solid rgba(201,168,76,0.08);
    transition: background 0.15s;
    animation: fadeRow 0.3s ease both;
  }

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

  tbody tr:hover {
    background: rgba(201,168,76,0.07);
  }

  tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
  }

  tbody tr:nth-child(even):hover {
    background: rgba(201,168,76,0.07);
  }

  td {
    padding: 11px 14px;
    color: rgba(247,240,224,0.88);
    vertical-align: middle;
  }

  .td-num {
    color: rgba(247,240,224,0.45);
    font-size: 12px;
    text-align: center;
  }

  .td-name {
    font-weight: 600;
    color: var(--cream);
    min-width: 200px;
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
  }

  .td-passport {
    font-family: monospace;
    font-size: 13px;
    color: var(--gold-light);
    letter-spacing: 0.5px;
  }

  .td-national {
    font-family: monospace;
    font-size: 12px;
    color: rgba(247,240,224,0.55);
    direction: ltr;
    text-align: left;
  }

  .room-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(201,168,76,0.15);
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 6px;
    padding: 3px 10px;
    font-weight: 700;
    color: var(--gold-light);
    font-size: 13px;
    min-width: 44px;
  }

  .floor-badge {
    display: inline-block;
    background: rgba(45,122,58,0.25);
    border: 1px solid rgba(45,122,58,0.5);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    color: #7ec87e;
    white-space: nowrap;
  }

  .relation-tag {
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    color: rgba(247,240,224,0.65);
    white-space: nowrap;
  }

  .region-text {
    font-size: 12px;
    color: rgba(247,240,224,0.65);
  }

  /* EMPTY STATE */
  .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(247,240,224,0.3);
  }

  .empty-state .icon { font-size: 48px; margin-bottom: 16px; }
  .empty-state p { font-size: 16px; }

  /* PAGINATION */
  .pagination {
    max-width: 1200px;
    margin: 0 auto 48px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .page-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 6px;
    padding: 7px 14px;
    color: rgba(247,240,224,0.65);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .page-btn:hover:not(:disabled) {
    background: rgba(201,168,76,0.12);
    border-color: rgba(201,168,76,0.5);
    color: var(--gold-light);
  }

  .page-btn.active {
    background: var(--gold-dark);
    border-color: var(--gold);
    color: var(--cream);
    font-weight: 700;
  }

  .page-btn:disabled { opacity: 0.3; cursor: default; }

  .page-info {
    font-size: 12px;
    color: rgba(247,240,224,0.35);
    text-align: center;
    margin-top: 8px;
  }

  /* LOADING */
  #loading {
    text-align: center;
    padding: 100px 20px;
    font-size: 18px;
    color: var(--gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(201,168,76,0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin { to { transform: rotate(360deg); } }

  /* HIGHLIGHT */
  .highlight {
    background: rgba(201,168,76,0.25);
    border-radius: 2px;
    color: var(--gold-light);
  }

  /* RESPONSIVE */
  @media (max-width: 768px) {
    .header-inner { padding: 20px 16px; }
    .header-text h1 { font-size: 20px; }
    .controls, .table-wrap, .pagination { padding: 0 16px; }
    .filters { gap: 8px; }
    .header-badge { display: none; }
    td, th { padding: 9px 10px; }
    .td-national { font-size: 11px; }
  }

  /* PRINT friendly */
  @media print {
    body { background: white; color: black; }
    header { background: #0a4d0f; }
  }

