:root {
  /* City Eye Center brand (matches cityeyecenter_dashboard) */
  --navy: #0B1D3A;
  --primary: #1565C0;
  --primary-dark: #0B1D3A;
  --teal: #00ACC1;
  --bg: #f2f5fa;
  --card: #ffffff;
  --text: #1a2433;
  --muted: #64748b;
  --green: #16a34a;
  --yellow: #d97706;
  --blue: #1565C0;
  --red: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(11, 29, 58, .08), 0 4px 16px rgba(11, 29, 58, .06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}
[dir="rtl"] body { font-family: Tahoma, 'Segoe UI', sans-serif; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.accent { color: var(--primary-dark); }
.error { color: var(--red); margin-top: 8px; }

/* ===== Login ===== */
#screen-login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--primary) 0%, var(--bg) 55%);
  padding: 20px;
}
.login-box {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px 24px; width: 100%; max-width: 380px; text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: 8px; }
.login-box h1 { margin-bottom: 4px; }
.login-box p { margin-bottom: 16px; }
.login-box input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid #d7e2ea; border-radius: 10px; font-size: 1rem;
  background: #fff; color: var(--text);
}
.login-box input:focus { outline: 2px solid var(--primary); border-color: transparent; }

/* ===== Buttons ===== */
.btn {
  padding: 12px 20px; border: none; border-radius: 10px;
  font-size: 1rem; cursor: pointer; background: #e4ebf1; color: var(--text);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-block { width: 100%; }
.icon-btn { background: none; border: none; font-size: 1.5rem; color: var(--text); cursor: pointer; padding: 6px 10px; }

/* ===== Topbar ===== */
.topbar {
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 12px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 1.4rem; font-weight: 500; color: #fff; }
.topbar .icon-btn { color: #fff; }

/* ===== Chip bar ===== */
.chipbar {
  background: #122a52; display: flex; justify-content: center; gap: 2px;
  padding: 10px; position: sticky; top: 58px; z-index: 19;
}
.chip {
  border: none; color: #fff; padding: 10px 18px; font-size: .95rem;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.chip-notif { background: var(--red); }
.chip-mail  { background: #16a34a; }
.chip-lang  { background: var(--teal); }

/* ===== Side menu ===== */
.sidemenu {
  position: fixed; top: 0; bottom: 0; inset-inline-start: -280px; width: 270px;
  background: var(--card); z-index: 40; transition: inset-inline-start .25s;
  box-shadow: var(--shadow); padding-top: 10px; overflow-y: auto;
}
.sidemenu.open { inset-inline-start: 0; }
.sidemenu-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px; border-bottom: 1px solid #e4ebf1; margin-bottom: 8px;
}
.sidemenu a {
  display: block; padding: 14px 20px; color: var(--text);
  text-decoration: none; cursor: pointer; font-size: 1rem;
}
.sidemenu a:hover { background: var(--bg); }
.sidemenu a.danger { color: var(--red); }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }

/* ===== Avatars ===== */
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 600;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  flex-shrink: 0;
}
.avatar.big { width: 76px; height: 76px; font-size: 2rem; border: 3px solid var(--primary); background: #fff; color: var(--primary-dark); }

/* ===== Content & cards ===== */
#content { max-width: 640px; margin: 0 auto; padding: 14px 12px 110px; }
.page h2 { margin: 6px 4px 14px; font-weight: 600; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 14px;
}
.welcome-card { display: flex; align-items: center; gap: 16px; }
.welcome-card h2 { font-weight: 500; }

.card.stat { display: flex; align-items: center; gap: 16px; cursor: pointer; }
.stat-icon {
  width: 52px; height: 52px; border-radius: 50%; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.stat-icon.green { background: var(--green); }
.stat-icon.yellow { background: var(--yellow); }
.stat-icon.blue { background: var(--blue); }
.stat-num { font-size: 1.7rem; font-weight: 600; }
.yellow-t { color: var(--yellow); }
.blue-t { color: var(--blue); }
.stat-label { color: var(--text); }

.card.action {
  text-align: center; cursor: pointer; padding: 26px 18px;
}
.action-icon { font-size: 2rem; margin-bottom: 10px; color: var(--primary); }
.card.action:active { background: #eef4f9; }

/* ===== List items ===== */
.list-item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.list-item .sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.badge {
  padding: 4px 12px; border-radius: 20px; font-size: .78rem; color: #fff; white-space: nowrap;
}
.badge.pending { background: var(--yellow); }
.badge.approved { background: var(--green); }
.badge.rejected { background: var(--red); }
.badge.in { background: var(--green); }
.badge.out { background: var(--muted); }

/* ===== FAB ===== */
.fab {
  position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); inset-inline-end: 20px;
  width: 64px; height: 64px; border-radius: 18px; border: none;
  background: var(--primary); color: #fff; font-size: 1.7rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(21, 101, 192, .45); z-index: 25;
}
.fab:active { background: var(--primary-dark); }

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-box {
  background: var(--card); border-radius: 18px 18px 0 0;
  width: 100%; max-width: 640px; padding: 24px 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.modal-box h3 { margin-bottom: 16px; }
.modal-box label { display: block; margin: 10px 0 4px; font-size: .9rem; color: var(--muted); }
.modal-box input, .modal-box select, .modal-box textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #d7e2ea; border-radius: 10px;
  font-size: 1rem; background: #fff; color: var(--text); font-family: inherit;
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 22px; border-radius: 24px;
  z-index: 60; font-size: .95rem; box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}

/* ===== Admin panel ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px; background: var(--navy); color: #fff; padding: 20px 0; flex-shrink: 0;
}
.admin-side h1 { font-size: 1.2rem; padding: 0 20px 16px; color: #fff; }
.admin-side a {
  display: block; padding: 12px 20px; color: #cfdde7; text-decoration: none; cursor: pointer;
}
.admin-side a.active, .admin-side a:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-main { flex: 1; padding: 24px; max-width: 1100px; }
.admin-main h2 { margin-bottom: 16px; }
table.grid { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.grid th, table.grid td { padding: 10px 12px; text-align: start; border-bottom: 1px solid #edf2f6; font-size: .92rem; }
table.grid th { background: #eef4f9; color: var(--text); }
.btn.sm { padding: 6px 12px; font-size: .82rem; }
.btn.approve { background: var(--green); color: #fff; }
.btn.reject { background: var(--red); color: #fff; }

@media (max-width: 720px) {
  .admin-layout { flex-direction: column; }
  .admin-side { width: 100%; display: flex; overflow-x: auto; padding: 0; align-items: center; }
  .admin-side h1 { padding: 12px 16px; white-space: nowrap; }
  .admin-side a { white-space: nowrap; }
}
