/* =============================================
   Beauty Clinic — Modern Dashboard Style
   ============================================= */
:root {
  --pink:      #C8498A;
  --pink2:     #e8679f;
  --pink-lt:   #fce9f2;
  --dark:      #1a0a12;
  --dark2:     #2a1220;
  --dark3:     #3d1a2e;
  --gold:      #D4A017;
  --green:     #22c55e;
  --blue:      #0ea5e9;
  --orange:    #f97316;
  --bg:        #f7f0f4;
  --card:      #ffffff;
  --text:      #1a0a12;
  --muted:     #8a6070;
  --border:    #f0dde8;
  --sidebar-w: 72px;
  --topbar-h:  64px;
  --r:         16px;
  --shadow:    0 2px 12px rgba(200,73,138,.08);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'IBM Plex Sans Arabic', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── LAYOUT ── */
.clinic-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 4px;
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  z-index: 200;
  border-radius: 0 0 0 0;
  transition: width .3s;
  overflow: hidden;
}

.sidebar-logo {
  width: 44px; height: 44px;
  background: var(--pink);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 20px;
  margin-bottom: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(200,73,138,.5);
}

.nav-item {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.35);
  font-size: 17px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active {
  background: var(--pink);
  color: white;
  box-shadow: 0 4px 14px rgba(200,73,138,.5);
}
.nav-item .nav-tooltip {
  position: absolute;
  left: -110px;
  background: var(--dark2);
  color: white;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.nav-item:hover .nav-tooltip { opacity: 1; }

.sidebar-bottom {
  margin-top: auto;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}

/* ── MAIN ── */
.main-wrap {
  flex: 1;
  margin-right: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0; z-index: 100;
}

.mobile-menu-btn {
  display: none;
  width: 40px; height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); font-size: 16px;
}

.search-wrap {
  flex: 1; max-width: 420px;
  background: var(--bg);
  border-radius: 12px;
  border: 1.5px solid var(--border);
  display: flex; align-items: center;
  padding: 9px 14px; gap: 8px;
}
.search-wrap input {
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 13px; color: var(--text); flex: 1;
  direction: rtl;
}
.search-wrap input::placeholder { color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-right: auto; }

.topbar-btn {
  width: 40px; height: 40px;
  background: var(--bg);
  border-radius: 10px;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); font-size: 15px;
  transition: all .2s; position: relative;
}
.topbar-btn:hover { border-color: var(--pink); color: var(--pink); }
.badge-dot {
  width: 8px; height: 8px; background: var(--pink);
  border-radius: 50%; position: absolute; top: 7px; left: 7px;
  border: 2px solid var(--card);
}

.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 6px 12px 6px 6px;
  cursor: pointer; transition: border-color .2s;
}
.user-chip:hover { border-color: var(--pink); }
.user-chip .avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--pink), var(--pink2));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
}
.user-chip .uname { font-size: 13px; font-weight: 600; }
.user-chip .urole { font-size: 10px; color: var(--muted); }

/* ── CONTENT ── */
.content { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

/* ── HERO BANNER ── */
.hero-banner {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 55%, #4a1630 100%);
  border-radius: 20px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
  min-height: 100px;
}
.hero-banner::before {
  content:'';
  position: absolute; top:-40px; left:-40px;
  width:200px; height:200px;
  background: radial-gradient(circle, rgba(200,73,138,.3) 0%, transparent 65%);
  pointer-events: none;
}
.hero-banner::after {
  content:'';
  position: absolute; bottom:-50px; right:100px;
  width:220px; height:220px;
  background: radial-gradient(circle, rgba(212,160,23,.12) 0%, transparent 65%);
  pointer-events: none;
}
.hero-text h2 {
  font-size: 20px; font-weight: 700; color: white; margin-bottom: 3px;
}
.hero-text p { font-size: 13px; color: rgba(255,255,255,.45); }
.live-dot {
  display: inline-block; width: 7px; height: 7px;
  background: var(--green); border-radius: 50%;
  margin-right: 5px;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.hero-stats { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.hero-stat { text-align: center; padding: 0 20px; }
.hero-stat .val {
  font-size: 26px; font-weight: 700;
  color: var(--pink2); line-height: 1;
}
.hero-stat .lbl { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 3px; }
.hero-divider { width: 1px; height: 40px; background: rgba(255,255,255,.1); }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 18px;
  border: 1.5px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  animation: fadeUp .4s ease both;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(200,73,138,.12);
}
.stat-card:nth-child(1){animation-delay:.05s}
.stat-card:nth-child(2){animation-delay:.1s}
.stat-card:nth-child(3){animation-delay:.15s}
.stat-card:nth-child(4){animation-delay:.2s}

.stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.stat-val { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-lbl { font-size: 12px; color: var(--muted); }
.stat-change {
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
.stat-change.up   { color: var(--green); }
.stat-change.down { color: #ef4444; }

/* ── CHARTS ROW ── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chart-card {
  background: var(--card);
  border-radius: var(--r);
  padding: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
}
.chart-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.chart-head h5 { font-size: 14px; font-weight: 700; }
.chart-head h5 i { margin-left: 6px; }
.time-sel {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 5px 10px;
  font-family: inherit; font-size: 12px; color: var(--muted);
  cursor: pointer; outline: none;
}

/* ── DASHBOARD BOTTOM ── */
.dash-bottom {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
}

/* ── TODAY APPOINTMENTS ── */
.appt-card {
  background: var(--card);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--border);
}
.card-head h5 { font-size: 14px; font-weight: 700; }
.btn-sm-pink {
  background: var(--pink-lt); color: var(--pink);
  border: none; border-radius: 8px;
  padding: 6px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background .2s;
}
.btn-sm-pink:hover { background: var(--pink); color: white; }

.appt-list { padding: 8px 0; }
.appt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  transition: background .15s;
}
.appt-row:hover { background: var(--bg); }

.appt-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--pink), var(--pink2));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.appt-info { flex: 1; min-width: 0; }
.appt-name { font-size: 13px; font-weight: 600; }
.appt-sub  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.appt-time {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 4px 10px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  white-space: nowrap; flex-shrink: 0;
}
.appt-badge {
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.badge-pending   { background:#fff7ed; color:var(--orange); }
.badge-confirmed { background:#e0f2fe; color:var(--blue); }
.badge-completed { background:#dcfce7; color:var(--green); }
.badge-cancelled { background:#fee2e2; color:#ef4444; }

.appt-empty {
  text-align: center; padding: 40px 20px;
  color: var(--muted); font-size: 14px;
}
.appt-empty i { font-size: 36px; opacity: .2; display: block; margin-bottom: 10px; }

/* ── QUICK BOOK PANEL ── */
.book-panel {
  background: var(--dark);
  border-radius: var(--r);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  border: 1.5px solid var(--dark3);
  box-shadow: var(--shadow);
}
.book-panel-title {
  font-size: 15px; font-weight: 700; color: white;
}

.cal-wrap {}
.cal-lbl { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.5); margin-bottom: 8px; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7,1fr);
  gap: 3px; text-align: center;
}
.cal-dn {
  font-size: 10px; color: rgba(255,255,255,.25);
  padding: 4px 0; font-weight: 600;
}
.cal-d {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: rgba(255,255,255,.45);
  cursor: pointer; margin: 0 auto;
  transition: all .15s;
}
.cal-d:hover { background: var(--dark3); color: white; }
.cal-d.today { background: var(--pink); color: white; font-weight: 700;
  box-shadow: 0 2px 8px rgba(200,73,138,.5); }
.cal-d.has   { background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); }
.cal-d.full  { color: rgba(255,255,255,.2); cursor: default; }

.time-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.tslot {
  background: var(--dark2); border: 1px solid var(--dark3);
  border-radius: 20px; padding: 6px 12px;
  font-size: 11px; color: rgba(255,255,255,.45);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.tslot:hover { border-color: var(--pink); color: white; }
.tslot.active { background: var(--pink); color: white; border-color: var(--pink); font-weight: 600; }
.tslot.taken  { opacity: .3; cursor: not-allowed; }

.book-btn {
  background: var(--pink); color: white;
  border: none; border-radius: 12px;
  padding: 13px; font-family: inherit;
  font-size: 14px; font-weight: 700;
  cursor: pointer; width: 100%;
  box-shadow: 0 4px 16px rgba(200,73,138,.4);
  transition: all .2s;
}
.book-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200,73,138,.5);
}
.book-form-row {
  display: flex; flex-direction: column; gap: 8px;
}
.book-select {
  background: var(--dark2); border: 1px solid var(--dark3);
  border-radius: 10px; padding: 10px 12px;
  color: rgba(255,255,255,.7); font-family: inherit;
  font-size: 13px; outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
}
.book-select option { background: var(--dark2); }
.book-select:focus { border-color: var(--pink); }

/* ── FLASH ── */
.flash {
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; display: flex; align-items: center; gap: 8px;
  animation: fadeUp .3s ease;
}
.flash-success { background:#dcfce7; color:#15803d; border: 1.5px solid #bbf7d0; }
.flash-warning { background:#fff7ed; color:#c2410c; border: 1.5px solid #fed7aa; }
.flash-danger  { background:#fee2e2; color:#dc2626; border: 1.5px solid #fecaca; }

/* ── PAGE HEADER ── */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap;
}
.page-header h4 { font-size: 20px; font-weight: 700; }
.page-header p  { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── GENERIC CARD ── */
.g-card {
  background: var(--card);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.g-card-body { padding: 20px; }

/* ── TABLE ── */
.g-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.g-table th {
  background: var(--bg); color: var(--muted);
  font-size: 12px; font-weight: 600;
  padding: 11px 14px;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.g-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.g-table tr:last-child td { border-bottom: none; }
.g-table tr:hover td { background: var(--bg); }

/* ── FORMS ── */
.g-input, .g-select, .g-textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit; font-size: 14px;
  color: var(--text); outline: none;
  transition: border-color .2s;
  direction: rtl;
}
.g-input:focus, .g-select:focus, .g-textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(200,73,138,.1);
}
.g-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: block; }

/* ── BUTTONS ── */
.btn-pink {
  background: var(--pink); color: white;
  border: none; border-radius: 10px;
  padding: 10px 18px; font-family: inherit;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-pink:hover { background: #b03878; transform: translateY(-1px); }
.btn-ghost {
  background: var(--bg); color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 10px; padding: 9px 16px;
  font-family: inherit; font-size: 13px;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-ghost:hover { border-color: var(--pink); color: var(--pink); }
.btn-icon {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); font-size: 13px;
  transition: all .2s;
}
.btn-icon:hover { border-color: var(--pink); color: var(--pink); }
.btn-icon.danger:hover { border-color:#ef4444; color:#ef4444; background:#fee2e2; }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(26,10,18,.5); backdrop-filter: blur(4px);
  z-index: 500; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--card);
  border-radius: 20px; padding: 28px;
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  animation: fadeUp .3s ease;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.modal-head h5 { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--muted);
}
.modal-close:hover { border-color: #ef4444; color: #ef4444; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── PAGINATION ── */
.pager { display: flex; gap: 4px; }
.pager a, .pager span {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--muted); transition: all .15s;
}
.pager a:hover, .pager span.current {
  background: var(--pink); border-color: var(--pink); color: white;
}

/* ── BADGE ── */
.badge {
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-pink    { background: var(--pink-lt); color: var(--pink); }
.badge-blue    { background: #e0f2fe; color: var(--blue); }
.badge-green   { background: #dcfce7; color: var(--green); }
.badge-orange  { background: #fff7ed; color: var(--orange); }
.badge-red     { background: #fee2e2; color: #ef4444; }
.badge-gray    { background: #f3f4f6; color: #6b7280; }

/* ── AVATAR ── */
.user-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--pink), var(--pink2));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}

/* ── PROGRESS ── */
.g-progress { height: 6px; background: var(--bg); border-radius: 20px; overflow: hidden; }
.g-progress-bar { height: 100%; background: var(--pink); border-radius: 20px; transition: width .5s; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}
.fade-in { animation: fadeUp .35s ease; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh; direction: rtl;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 50%, #3d1030 100%);
}
.login-card {
  background: var(--card); border-radius: 24px;
  padding: 40px 36px; width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  animation: fadeUp .4s ease;
}
.login-logo {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, var(--pink), var(--pink2));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: white; margin: 0 auto 18px;
  box-shadow: 0 8px 24px rgba(200,73,138,.4);
}
.alert-err {
  background: #fee2e2; border: 1.5px solid #fecaca;
  border-radius: 10px; padding: 10px 14px;
  font-size: 13px; color: #dc2626;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.input-group-icon { position: relative; }
.input-group-icon .g-input { padding-right: 40px; }
.input-group-icon .ico {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); color: var(--muted); font-size: 14px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .dash-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(100%);
    width: 240px !important;
    border-radius: 0 0 0 20px;
    transition: transform .3s;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open .nav-item { width: 100%; border-radius: 10px; justify-content: flex-start; padding: 0 16px; gap: 12px; }
  .sidebar.open .nav-item span { display: block; font-size: 13px; color: rgba(255,255,255,.7); }
  .sidebar.open .nav-item.active span { color: white; }

  .main-wrap { margin-right: 0; }
  .mobile-menu-btn { display: flex; }

  .topbar { padding: 0 16px; }
  .search-wrap { max-width: 200px; }
  .user-chip .uname, .user-chip .urole { display: none; }

  .content { padding: 16px; gap: 14px; }

  .hero-banner { flex-direction: column; align-items: flex-start; padding: 20px; }
  .hero-stats { width: 100%; justify-content: space-around; }
  .hero-stat .val { font-size: 20px; }

  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .stat-val { font-size: 22px; }

  .charts-row { grid-template-columns: 1fr; }
  .dash-bottom { grid-template-columns: 1fr; }

  .book-panel { order: -1; }

  .g-table th, .g-table td { padding: 9px 10px; font-size: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .hero-stat .val { font-size: 18px; }
  .modal-box { padding: 20px; }
}

/* ── OVERLAY backdrop for mobile sidebar ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 199;
}
.sidebar-overlay.open { display: block; }
