:root {
      --green:  #006233;
      --green2: #004d27;
      --red:    #C8102E;
      --gold:   #c9a84c;
      --white:  #F8F5F0;
      --cream:  #fdf9f4;
      --dark:   #0d1a0f;
      --dark2:  #111f13;
      --muted:  rgba(255,255,255,0.45);
      --border: rgba(0,98,51,0.35);
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html, body { height: 100%; overflow: hidden; font-family: 'Cairo', sans-serif; }

    body {
      background: var(--dark);
      color: var(--white);
      display: flex;
      flex-direction: column;
    }

    /* ── SCROLLBAR ── */
    ::-webkit-scrollbar { width: 5px; }
    ::-webkit-scrollbar-track { background: var(--dark2); }
    ::-webkit-scrollbar-thumb { background: var(--green); border-radius: 3px; }

    /* ══════════════════════════════
       HEADER
    ══════════════════════════════ */
    header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 0 40px;
      height: 68px;
      background: rgba(13,26,15,0.97);
      backdrop-filter: blur(24px);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      z-index: 1000;
      position: relative;
    }

    .logo { display: flex; align-items: center; gap: 11px; text-decoration: none; }
    .logo-icon {
      width: 38px; height: 38px; border-radius: 9px;
      background: var(--green); display: flex; align-items: center; justify-content: center;
      border: 1.5px solid rgba(0,150,70,0.5);
    }
    .logo-text {
      font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 900;
      background: linear-gradient(135deg, var(--white), var(--gold));
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    }

    .header-right { display: flex; align-items: center; gap: 14px; }

    .user-badge {
      display: flex; align-items: center; gap: 9px;
      padding: 7px 16px;
      background: rgba(0,98,51,0.15);
      border: 1px solid rgba(0,98,51,0.4);
      border-radius: 40px;
      font-size: .82rem; font-weight: 600;
    }
    .user-dot {
      width: 8px; height: 8px; border-radius: 50%;
      background: #4cde80;
      box-shadow: 0 0 6px #4cde80;
    }

    .btn-logout {
      display: flex; align-items: center; gap: 7px;
      padding: 7px 16px;
      background: rgba(200,16,46,0.12);
      border: 1px solid rgba(200,16,46,0.35);
      border-radius: 40px;
      font-family: 'Cairo', sans-serif;
      font-size: .82rem; font-weight: 600; color: #ff8a9a;
      cursor: pointer; transition: all .3s;
    }
    .btn-logout:hover { background: rgba(200,16,46,0.22); border-color: var(--red); }

    .btn-home {
      display: flex; align-items: center; gap: 7px;
      padding: 7px 16px;
      background: rgba(255,255,255,0.06);
      border: 1px solid var(--border);
      border-radius: 40px;
      font-family: 'Cairo', sans-serif;
      font-size: .82rem; font-weight: 600; color: var(--muted);
      cursor: pointer; text-decoration: none;
      transition: all .3s;
    }
    .btn-home:hover { background: rgba(255,255,255,0.1); color: var(--white); }

    /* ══════════════════════════════
       LAYOUT
    ══════════════════════════════ */
    .app-body {
      flex: 1;
      display: flex;
      overflow: hidden;
      position: relative;
    }

    /* ══════════════════════════════
       SIDEBAR
    ══════════════════════════════ */
    .sidebar {
      width: 340px;
      flex-shrink: 0;
      background: rgba(13,26,15,0.96);
      border-left: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      z-index: 500;
      transition: transform .35s cubic-bezier(.4,0,.2,1);
    }

    .sidebar-header {
      padding: 22px 22px 14px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }

    .sidebar-title {
      font-family: 'Playfair Display', serif;
      font-size: 1.25rem; font-weight: 900;
      color: var(--white); margin-bottom: 14px;
    }

    /* search */
    .search-wrap {
      position: relative;
    }
    .search-wrap svg {
      position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
      pointer-events: none; opacity: .5;
    }
    #search-input {
      width: 100%;
      padding: 11px 42px 11px 14px;
      background: rgba(255,255,255,0.06);
      border: 1px solid var(--border);
      border-radius: 10px;
      font-family: 'Cairo', sans-serif;
      font-size: .88rem; color: var(--white);
      outline: none; transition: border-color .3s;
    }
    #search-input::placeholder { color: rgba(255,255,255,0.3); }
    #search-input:focus { border-color: var(--green); }

    /* filters */
    .filters {
      display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
    }
    .filter-chip {
      padding: 5px 13px;
      border-radius: 20px;
      font-family: 'Cairo', sans-serif;
      font-size: .75rem; font-weight: 700;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.04);
      color: var(--muted);
      cursor: pointer; transition: all .25s;
    }
    .filter-chip:hover, .filter-chip.active {
      background: rgba(0,98,51,0.2);
      border-color: var(--green);
      color: #7dcc9a;
    }

    /* stats */
    .sidebar-stats {
      display: flex; gap: 10px; padding: 14px 22px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .stat-box {
      flex: 1; text-align: center;
      background: rgba(255,255,255,0.04);
      border: 1px solid var(--border);
      border-radius: 10px; padding: 10px 6px;
    }
    .stat-num {
      font-family: 'Playfair Display', serif;
      font-size: 1.5rem; font-weight: 900; color: var(--gold);
    }
    .stat-label { font-size: .7rem; color: var(--muted); margin-top: 2px; }

    /* restaurant list */
    .rest-list {
      flex: 1; overflow-y: auto; padding: 14px;
      display: flex; flex-direction: column; gap: 10px;
    }

    .rest-card {
      background: rgba(255,255,255,0.04);
      border: 1.5px solid var(--border);
      border-radius: 13px; padding: 15px;
      cursor: pointer; transition: all .25s;
      position: relative; overflow: hidden;
    }
    .rest-card::before {
      content: ''; position: absolute; right: 0; top: 0; bottom: 0;
      width: 3px; background: var(--green);
      opacity: 0; transition: opacity .25s;
    }
    .rest-card:hover, .rest-card.selected {
      border-color: var(--green);
      background: rgba(0,98,51,0.1);
      transform: translateX(3px);
    }
    .rest-card:hover::before, .rest-card.selected::before { opacity: 1; }

    .rest-card-top {
      display: flex; align-items: flex-start; gap: 12px;
    }
    .rest-avatar {
      width: 44px; height: 44px; border-radius: 10px;
      background: rgba(0,98,51,0.25);
      border: 1px solid rgba(0,98,51,0.4);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.3rem; flex-shrink: 0;
    }
    .rest-info { flex: 1; min-width: 0; }
    .rest-name {
      font-weight: 700; font-size: .95rem; color: var(--white);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .rest-type {
      font-size: .75rem; color: var(--muted); margin-top: 2px;
    }
    .rest-open-badge {
      font-size: .68rem; font-weight: 700; padding: 3px 9px;
      border-radius: 20px; flex-shrink: 0;
    }
    .open { background: rgba(0,200,80,0.15); color: #4cde80; border: 1px solid rgba(0,200,80,0.3); }
    .closed { background: rgba(200,16,46,0.12); color: #ff8a9a; border: 1px solid rgba(200,16,46,0.25); }

    .rest-card-meta {
      display: flex; gap: 14px; margin-top: 10px;
      font-size: .76rem; color: var(--muted);
    }
    .rest-meta-item { display: flex; align-items: center; gap: 5px; }
    .rest-meta-item svg { opacity: .6; }

    .rest-btn-locate {
      margin-top: 10px; width: 100%;
      padding: 8px;
      background: rgba(0,98,51,0.18);
      border: 1px solid rgba(0,98,51,0.4);
      border-radius: 8px;
      font-family: 'Cairo', sans-serif;
      font-size: .78rem; font-weight: 700; color: #7dcc9a;
      cursor: pointer; transition: all .25s;
    }
    .rest-btn-locate:hover { background: rgba(0,98,51,0.35); }

    .empty-state {
      text-align: center; padding: 48px 20px; color: var(--muted);
    }
    .empty-state svg { opacity: .3; margin-bottom: 12px; }
    .empty-state p { font-size: .88rem; }

    /* ══════════════════════════════
       MAP
    ══════════════════════════════ */
    #map {
      flex: 1;
      background: var(--dark2);
      min-height: 400px;
      height: 100%;
      width: 100%;
    }

    /* ══════════════════════════════
       MY LOCATION BTN (on map)
    ══════════════════════════════ */
    .map-controls {
      position: absolute;
      bottom: 30px;
      left: 24px;
      z-index: 600;
      display: flex; flex-direction: column; gap: 10px;
    }

    .map-ctrl-btn {
      display: flex; align-items: center; gap: 8px;
      padding: 11px 18px;
      background: rgba(13,26,15,0.95);
      backdrop-filter: blur(16px);
      border: 1px solid var(--border);
      border-radius: 12px;
      font-family: 'Cairo', sans-serif;
      font-size: .82rem; font-weight: 700;
      color: var(--white);
      cursor: pointer; transition: all .3s;
      box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    }
    .map-ctrl-btn:hover { border-color: var(--green); color: #7dcc9a; }
    .map-ctrl-btn.locating {
      border-color: var(--green); color: #7dcc9a;
      animation: pulse-border 1.2s infinite;
    }
    @keyframes pulse-border {
      0%,100% { box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
      50% { box-shadow: 0 4px 24px rgba(0,98,51,0.4); }
    }

    /* ══════════════════════════════
       RESTAURANT COUNT BADGE (map)
    ══════════════════════════════ */
    .map-badge {
      position: absolute;
      top: 16px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 600;
      background: rgba(13,26,15,0.95);
      backdrop-filter: blur(16px);
      border: 1px solid var(--border);
      border-radius: 40px;
      padding: 8px 20px;
      font-size: .82rem; font-weight: 600; color: var(--muted);
      pointer-events: none;
      box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    }
    .map-badge span { color: var(--gold); font-weight: 800; }

    /* ══════════════════════════════
       LEAFLET POPUP CUSTOM
    ══════════════════════════════ */
    .leaflet-popup-content-wrapper {
      background: rgba(13,26,15,0.97) !important;
      border: 1.5px solid rgba(0,98,51,0.5) !important;
      border-radius: 14px !important;
      color: var(--white) !important;
      box-shadow: 0 8px 40px rgba(0,0,0,0.5) !important;
      backdrop-filter: blur(20px) !important;
      font-family: 'Cairo', sans-serif !important;
      min-width: 240px !important;
    }
    .leaflet-popup-tip { background: rgba(13,26,15,0.97) !important; }
    .leaflet-popup-close-button { color: rgba(255,255,255,0.4) !important; font-size: 18px !important; }
    .leaflet-popup-close-button:hover { color: var(--white) !important; }

    .popup-inner { padding: 6px 4px; }
    .popup-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
    .popup-icon {
      width: 42px; height: 42px; border-radius: 10px;
      background: rgba(0,98,51,0.25);
      border: 1px solid rgba(0,98,51,0.5);
      display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    }
    .popup-name { font-weight: 800; font-size: 1rem; color: var(--white); }
    .popup-type { font-size: .75rem; color: var(--muted); margin-top: 2px; }
    .popup-row {
      display: flex; align-items: center; gap: 8px;
      font-size: .78rem; color: rgba(255,255,255,0.6);
      margin-bottom: 7px;
    }
    .popup-row svg { flex-shrink: 0; }
    .popup-sep { height: 1px; background: var(--border); margin: 10px 0; }
    .popup-badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
    .popup-badge {
      font-size: .7rem; font-weight: 700; padding: 3px 10px;
      border-radius: 20px;
      background: rgba(201,168,76,0.15); color: var(--gold);
      border: 1px solid rgba(201,168,76,0.3);
    }
    .popup-actions { display: flex; gap: 8px; }
    .popup-btn {
      flex: 1; padding: 9px;
      border-radius: 8px;
      font-family: 'Cairo', sans-serif;
      font-size: .78rem; font-weight: 700;
      cursor: pointer; border: none; transition: all .25s;
      text-align: center;
    }
    .popup-btn-primary {
      background: var(--green); color: var(--white);
    }
    .popup-btn-primary:hover { background: #007a3d; }
    .popup-btn-sec {
      background: rgba(255,255,255,0.06);
      border: 1px solid var(--border);
      color: var(--muted);
    }
    .popup-btn-sec:hover { color: var(--white); background: rgba(255,255,255,0.1); }

    /* ══════════════════════════════
       TOAST
    ══════════════════════════════ */
    .toast {
      position: fixed; bottom: 30px; right: 30px; z-index: 9000;
      display: flex; align-items: center; gap: 12px;
      padding: 14px 20px;
      background: rgba(13,26,15,0.97);
      border: 1px solid var(--border);
      border-radius: 12px;
      font-size: .85rem; font-weight: 600;
      box-shadow: 0 8px 40px rgba(0,0,0,0.4);
      backdrop-filter: blur(20px);
      transform: translateY(80px); opacity: 0;
      transition: all .4s cubic-bezier(.4,0,.2,1);
      pointer-events: none;
    }
    .toast.show { transform: translateY(0); opacity: 1; }
    .toast.success { border-color: rgba(0,150,70,0.5); }
    .toast.error   { border-color: rgba(200,16,46,0.4); }
    .toast-icon { font-size: 1.1rem; }

    /* ══════════════════════════════
       CUSTOM MARKERS
    ══════════════════════════════ */
    .custom-marker {
      width: 40px; height: 40px;
      border-radius: 50% 50% 50% 0;
      transform: rotate(-45deg);
      display: flex; align-items: center; justify-content: center;
      border: 2.5px solid rgba(255,255,255,0.25);
      box-shadow: 0 4px 16px rgba(0,0,0,0.4);
      cursor: pointer;
    }
    .custom-marker .inner {
      transform: rotate(45deg);
      font-size: 16px;
    }
    .marker-rest { background: var(--green); }
    .marker-me   { background: var(--gold); }
    .my-location-pulse {
      width: 16px; height: 16px; border-radius: 50%;
      background: var(--gold);
      box-shadow: 0 0 0 0 rgba(201,168,76,0.4);
      animation: my-pulse 2s infinite;
    }
    @keyframes my-pulse {
      0%   { box-shadow: 0 0 0 0 rgba(201,168,76,0.4); }
      70%  { box-shadow: 0 0 0 16px rgba(201,168,76,0); }
      100% { box-shadow: 0 0 0 0 rgba(201,168,76,0); }
    }

    /* ══════════════════════════════
       NO-LOGIN OVERLAY
    ══════════════════════════════ */
    #no-login-overlay {
      display: none;
      position: absolute; inset: 0;
      background: rgba(13,26,15,0.97);
      backdrop-filter: blur(20px);
      z-index: 800;
      align-items: center; justify-content: center;
      flex-direction: column; gap: 20px;
      text-align: center; padding: 32px;
    }
    #no-login-overlay.show { display: flex; }
    .overlay-title {
      font-family: 'Playfair Display', serif;
      font-size: 1.8rem; font-weight: 900; color: var(--white);
    }
    .overlay-sub { color: var(--muted); max-width: 320px; line-height: 1.7; }
    .overlay-btn {
      display: inline-flex; align-items: center; gap: 9px;
      padding: 13px 28px;
      background: var(--green); color: var(--white);
      border-radius: 40px;
      font-family: 'Cairo', sans-serif;
      font-size: .9rem; font-weight: 700;
      text-decoration: none; transition: background .3s;
    }
    .overlay-btn:hover { background: #007a3d; }

    /* MOBILE sidebar toggle */
    .sidebar-toggle {
      display: none;
      position: absolute; top: 14px; right: 360px;
      z-index: 700;
      width: 36px; height: 36px;
      background: rgba(13,26,15,0.9);
      border: 1px solid var(--border);
      border-radius: 8px;
      align-items: center; justify-content: center;
      cursor: pointer; color: var(--white);
    }

    @media (max-width: 700px) {
      .sidebar { position: absolute; right: 0; top: 0; bottom: 0; transform: translateX(0); }
      .sidebar.collapsed { transform: translateX(340px); }
      .sidebar-toggle { display: flex; }
      .map-controls { left: 14px; bottom: 20px; }
    }