/* ============================================================
   WaktiPlus — Admin & Client Dashboard Shared Styles
   ============================================================ */

/* --- Dashboard Layout --- */
.dash-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  background: #0D0D1F;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  box-shadow: 4px 0 24px rgba(0, 0, 0, .25);
}

.sidebar-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: linear-gradient(180deg, #0D0D1F 0%, #12122A 100%);
}

.sidebar-logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.sidebar-logo span {
  color: var(--color-primary);
}

.sidebar-role {
  font-size: 0.70rem;
  color: rgba(255, 196, 80, .75);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-top: 6px;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .28);
  padding: 14px 20px 4px;
  font-weight: 700;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, .6);
  transition: all var(--transition);
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.sidebar-nav a:hover {
  color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .06);
  border-left-color: rgba(249, 115, 22, .5);
}

.sidebar-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(249, 115, 22, .2) 0%, rgba(249, 115, 22, .05) 100%);
  border-left-color: #F97316;
}

.sidebar-nav a .nav-icon {
  font-size: 1.1rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Sidebar icon image — full natural color, opacity-only dimming */
.sicon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  opacity: 0.5;
  transition: opacity 0.2s;
  /* NO filter — icons keep their real colors */
}

.sidebar-nav a:hover .sicon {
  opacity: 0.88;
}

.sidebar-nav a.active .sicon {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(249, 115, 22, .4));
}

.sidebar-footer a .sicon {
  opacity: 0.4;
}

/* Footer logout link */
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .7);
  transition: all .2s;
}

.sidebar-footer a:hover {
  background: rgba(239, 68, 68, .15);
  color: #FCA5A5;
}

/* --- Main Content Area --- */
.dash-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg);
}

/* --- Top bar --- */
.topbar {
  background: #fff;
  border-bottom: 2px solid var(--color-border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

.topbar-title small {
  font-family: var(--font-arabic);
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-m);
  font-weight: 400;
  direction: rtl;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F97316, #FBBF24);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(249, 115, 22, .35);
}

.topbar-menu-btn {
  display: none;
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  font-size: 1.3rem;
  color: var(--color-text);
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1;
  transition: background 0.15s;
}

.topbar-menu-btn:hover {
  background: var(--color-bg);
}

/* --- Page Content --- */
.page-content {
  padding: 28px;
  flex: 1;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.5rem;
  color: var(--color-text);
}

.page-header h1 small {
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  color: var(--color-text-m);
  font-weight: 400;
  direction: rtl;
  display: block;
  margin-top: 2px;
}

/* --- Cards — stronger border & contrast --- */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1.5px solid var(--color-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

/* --- Reservation Cards (Mobile) --- */
.resa-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1.5px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.resa-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #C4A87A;
}

.resa-card.resa-pending {
  border-left: 4px solid var(--color-warning);
}

.resa-card.resa-confirmed {
  border-left: 4px solid var(--color-success);
}

.resa-card.resa-rejected {
  border-left: 4px solid var(--color-danger);
}

.resa-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.resa-name {
  font-weight: 700;
  font-size: 1rem;
}

.resa-time {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary);
}

.resa-detail {
  font-size: 0.83rem;
  color: var(--color-text-m);
  margin-bottom: 3px;
}

.resa-detail span {
  font-family: var(--font-arabic);
  direction: rtl;
}

.resa-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.resa-actions .btn {
  flex: 1;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--color-bg);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 20px;
  border: 1.5px solid var(--color-border);
}

.tab-btn {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-m);
  transition: all var(--transition);
  cursor: pointer;
  text-align: center;
}

.tab-btn.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .35);
}

/* --- Service Card --- */
.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--color-border);
}

.service-item:last-child {
  border-bottom: none;
}

.service-desc {
  flex: 1;
}

.service-desc .name-fr {
  font-weight: 600;
}

.service-desc .name-ar {
  font-family: var(--font-arabic);
  font-size: 0.83rem;
  color: var(--color-text-m);
  direction: rtl;
}

.service-meta {
  font-size: 0.82rem;
  color: var(--color-text-m);
  margin-top: 4px;
}

.service-actions {
  display: flex;
  gap: 6px;
  margin-left: 16px;
}

/* --- Working hours grid --- */
.wh-grid {
  display: grid;
  grid-template-columns: 140px 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1.5px solid var(--color-border);
}

.wh-grid:last-child {
  border-bottom: none;
}

.wh-day {
  font-weight: 600;
}

.wh-day .ar {
  font-family: var(--font-arabic);
  font-size: 0.8rem;
  color: var(--color-text-m);
  direction: rtl;
}

/* --- Subscription warning banner --- */
.sub-banner {
  background: var(--color-warning-l);
  color: #92400e;
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.sub-banner .ar {
  font-family: var(--font-arabic);
  direction: rtl;
  font-size: 0.85em;
}

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
  padding: 24px;
}

.login-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid var(--color-border);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -1px;
}

.login-logo h1 span {
  color: var(--color-primary);
}

.login-logo p {
  color: var(--color-text-m);
  font-size: 0.85rem;
  margin-top: 6px;
}

.login-logo .ar {
  font-family: var(--font-arabic);
  direction: rtl;
}

/* --- Mobile sidebar --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 99;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .dash-main {
    margin-left: 0;
  }

  .topbar-menu-btn {
    display: flex;
  }

  .page-content {
    padding: 16px;
  }

  .wh-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }

  .page-content {
    padding: 12px;
  }
}

/* ---- Page 2-column grid for admin edit ---- */
.page-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .page-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ---- Extra button variants ---- */
.btn-danger {
  background: var(--color-danger, #EF4444);
  color: #fff;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-secondary {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: var(--color-bg);
}

.btn-sm {
  padding: 6px 14px;
  font-size: .82rem;
}

/* ---- spacing helpers ---- */
.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

/* ---- section-label ---- */
.section-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--color-text-m);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--color-border);
}

/* ---- Sidebar footer ---- */
.sidebar-footer {
  padding: 12px 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

/* ---- Topbar avatar — warm gradient ---- */
.topbar-avatar {
  background: linear-gradient(135deg, #F97316, #FBBF24) !important;
  color: #fff !important;
}

/* ---- Reservation tab icons ---- */
.tab-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  margin: 0 auto 2px;
}

.tab-btn {
  position: relative;
}

.tab-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #F43F5E;
  color: #fff;
  border-radius: 99px;
  font-size: .62rem;
  font-weight: 800;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
}

/* ---- Clients toolbar ---- */
.clients-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.clients-search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.clients-search-form .form-control {
  max-width: 220px;
}

/* ---- Client card grid (mobile-first) ---- */
.clients-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.client-card {
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow .2s, border-color .2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.client-card:hover {
  border-color: #F97316;
  box-shadow: 0 4px 20px rgba(249, 115, 22, .12);
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F97316, #FBBF24);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.client-card-body {
  flex: 1;
  min-width: 0;
}

.client-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--color-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-contact {
  font-size: .75rem;
  color: var(--color-text-m);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-link {
  color: #10B981;
  text-decoration: none;
}

.wa-link:hover {
  text-decoration: underline;
}

.client-stats {
  text-align: center;
  flex-shrink: 0;
}

.client-stat-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: #F97316;
  line-height: 1;
}

.client-stat-lbl {
  font-size: .62rem;
  font-weight: 700;
  color: var(--color-text-m);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ---- Stat cards — colored left accent per type ---- */
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1.5px solid var(--color-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card .stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--color-text-m);
  margin-top: 4px;
}

.stat-card .stat-label .ar {
  font-family: var(--font-arabic);
  direction: rtl;
  display: block;
  font-size: 0.75rem;
}

/* ---- Mobile responsive ---- */
@media (max-width: 600px) {
  .clients-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .clients-search-form {
    width: 100%;
  }

  .clients-search-form .form-control {
    max-width: 100%;
    flex: 1;
  }

  .clients-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Shared admin mobile fixes ── */

/* 4-column stat grid → 2 columns on tablet, 2 on phone */
@media (max-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .stat-card .stat-num {
    font-size: 1.3rem;
  }

  .stat-card .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}

/* Dash main content padding on mobile */
@media (max-width: 768px) {
  .dash-main {
    padding: 16px 12px 40px !important;
  }

  .topbar {
    padding: 0 12px;
  }
}

/* Tables: horizontal scroll on small screens */
@media (max-width: 768px) {
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tbl {
    min-width: 480px;
  }

  /* Hide less critical columns */
  .hide-mobile {
    display: none !important;
  }
}

/* Card header flex wrap on small screens */
@media (max-width: 600px) {
  .card-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-header>* {
    min-width: 0;
  }
}

/* Stat cards — compact on very small */
@media (max-width: 360px) {
  .stat-card {
    padding: 12px !important;
    gap: 10px !important;
  }

  .stat-card .stat-num {
    font-size: 1.1rem;
  }
}

/* Billing/month nav buttons */
.billing-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

.billing-month-label {
  text-align: center;
}