/* =====================================================
   BookingPro — Provider Portal Styles
   ===================================================== */

:root {
  --portal-sidebar-w: 240px;
  --portal-bg:        #f1f5f9;
  --portal-surface:   #ffffff;
  --portal-border:    #e2e8f0;
  --portal-text:      #1e293b;
  --portal-muted:     #64748b;
  --portal-primary:   #2563eb;
  --portal-success:   #10b981;
  --portal-warning:   #f59e0b;
  --portal-danger:    #ef4444;
  --portal-radius:    12px;
  --portal-shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}

/* ── Layout ───────────────────────────────────────── */
.bp-portal-wrap {
  display: flex;
  min-height: 100vh;
  background: var(--portal-bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--portal-text);
}

/* ── Sidebar ──────────────────────────────────────── */
.bp-portal-sidebar {
  width: var(--portal-sidebar-w);
  background: #1e293b;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.bp-portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.bp-portal-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.bp-portal-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.bp-portal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bp-portal-user-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.bp-portal-user-info span {
  font-size: 11px;
  color: #94a3b8;
}

.bp-portal-nav {
  flex: 1;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bp-portal-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  transition: all .15s;
  position: relative;
}

.bp-portal-nav-item:hover {
  color: #f1f5f9;
  background: rgba(255,255,255,.06);
}

.bp-portal-nav-item.active {
  color: #fff;
  background: rgba(37,99,235,.35);
  border-right: 3px solid var(--portal-primary);
}

.bp-nav-badge {
  background: var(--portal-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  margin-left: auto;
}

.bp-portal-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.bp-portal-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  transition: color .15s;
}

.bp-portal-logout:hover {
  color: #f1f5f9;
}

/* ── Main Content ─────────────────────────────────── */
.bp-portal-main {
  flex: 1;
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bp-portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.bp-portal-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--portal-text);
  margin: 0 0 2px;
}

.bp-portal-page-subtitle {
  font-size: 13px;
  color: var(--portal-muted);
  margin: 0;
}

.bp-portal-main > *:not(.bp-portal-topbar) {
  margin: 20px 28px;
}

/* ── Stats Cards ──────────────────────────────────── */
.bp-portal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.bp-pstat-card {
  background: var(--portal-surface);
  border-radius: var(--portal-radius);
  padding: 20px;
  box-shadow: var(--portal-shadow);
  border-left: 4px solid var(--c, #3b82f6);
}

.bp-pstat-icon {
  font-size: 22px;
  margin-bottom: 8px;
}

.bp-pstat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--c, #3b82f6);
  line-height: 1;
  margin-bottom: 4px;
}

.bp-pstat-label {
  font-size: 12px;
  color: var(--portal-muted);
  font-weight: 500;
}

/* ── Portal Card ──────────────────────────────────── */
.bp-portal-card {
  background: var(--portal-surface);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
  overflow: hidden;
}

.bp-portal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--portal-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--portal-text);
}

.bp-portal-card-body {
  padding: 20px;
}

.bp-link-sm {
  font-size: 12px;
  color: var(--portal-primary);
  text-decoration: none;
  font-weight: 500;
}

.bp-link-sm:hover { text-decoration: underline; }

/* ── Grid ─────────────────────────────────────────── */
.bp-portal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 28px;
}

/* ── Appointment Row ──────────────────────────────── */
.bp-portal-apt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f8fafc;
}

.bp-portal-apt-row:last-child { border-bottom: none; }

.bp-portal-apt-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
  font-size: 13px;
}

.bp-portal-apt-time strong { color: var(--portal-text); }
.bp-portal-apt-time small  { color: var(--portal-muted); font-size: 11px; }

.bp-portal-apt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bp-portal-apt-info {
  flex: 1;
  min-width: 0;
}

.bp-portal-apt-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--portal-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bp-portal-apt-info span {
  font-size: 12px;
  color: var(--portal-muted);
}

.bp-portal-apt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bp-price-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--portal-text);
  flex-shrink: 0;
}

/* ── Status Badges ────────────────────────────────── */
.bp-badge-status {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.bp-badge-success { background: #d1fae5; color: #065f46; }
.bp-badge-warning { background: #fef3c7; color: #92400e; }
.bp-badge-danger  { background: #fee2e2; color: #991b1b; }
.bp-badge-info    { background: #dbeafe; color: #1e40af; }
.bp-badge-secondary { background: #f3f4f6; color: #374151; }

/* ── Icon Buttons ─────────────────────────────────── */
.bp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--portal-border);
  color: var(--portal-muted);
  text-decoration: none;
  transition: all .15s;
  background: var(--portal-surface);
}

.bp-icon-btn:hover {
  border-color: var(--portal-primary);
  color: var(--portal-primary);
  background: #eff6ff;
}

.bp-icon-btn-danger:hover {
  border-color: var(--portal-danger);
  color: var(--portal-danger);
  background: #fef2f2;
}

/* ── Quick Actions ────────────────────────────────── */
.bp-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.bp-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: #f8fafc;
  border: 1.5px solid var(--portal-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--portal-text);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  text-align: center;
}

.bp-quick-action:hover {
  border-color: var(--portal-primary);
  background: #eff6ff;
  color: var(--portal-primary);
  transform: translateY(-2px);
}

.bp-qa-icon { font-size: 24px; }

/* ── Table ────────────────────────────────────────── */
.bp-portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bp-portal-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--portal-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--portal-border);
}

.bp-portal-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
}

.bp-portal-table tr:last-child td { border-bottom: none; }
.bp-portal-table tr:hover td { background: #fafbfc; }

/* ── Filter Bar ───────────────────────────────────── */
.bp-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--portal-surface);
  padding: 14px 20px;
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
}

/* ── Schedule ─────────────────────────────────────── */
.bp-schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-sched-row {
  display: grid;
  grid-template-columns: 44px 130px 1fr 80px;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1.5px solid var(--portal-border);
  transition: all .15s;
}

.bp-sched-row:not(.bp-sched-off):hover { border-color: var(--portal-primary); }
.bp-sched-off { opacity: .55; }
.bp-sched-day { font-size: 13px; font-weight: 600; color: var(--portal-text); }

.bp-sched-times {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity .2s;
}

.bp-time-inp {
  padding: 7px 10px;
  border: 1.5px solid var(--portal-border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--portal-text);
  background: #fff;
  width: auto;
}

.bp-sched-sep { color: var(--portal-muted); font-weight: 500; }

.bp-badge-dot-green { background: #d1fae5; color: #065f46; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.bp-badge-dot-gray  { background: #f3f4f6; color: #6b7280;  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* ── Breaks & Special Days ────────────────────────── */
.bp-break-row,
.bp-special-day-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f8fafc;
  flex-wrap: wrap;
}

.bp-break-row:last-child,
.bp-special-day-row:last-child { border-bottom: none; }

.bp-inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--portal-muted);
  cursor: pointer;
  white-space: nowrap;
}

.bp-special-times {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Status Buttons ───────────────────────────────── */
.bp-quick-status-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bp-status-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--portal-border);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--portal-muted);
  transition: all .15s;
  font-family: inherit;
}

.bp-status-btn:hover { border-color: var(--portal-primary); color: var(--portal-primary); background: #eff6ff; }
.bp-status-btn-active { border-color: var(--portal-primary); background: #eff6ff; color: var(--portal-primary); font-weight: 600; }
.bp-status-btn-active-green { border-color: var(--portal-success); background: #d1fae5; color: #065f46; font-weight: 600; }

/* ── Day Toggle ───────────────────────────────────── */
.bp-day-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.bp-day-toggle input { opacity: 0; width: 0; height: 0; }

.bp-day-toggle .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 10px;
  transition: .25s;
}

.bp-day-toggle input:checked + .slider { background: var(--portal-primary); }

.bp-day-toggle .slider:before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .25s;
}

.bp-day-toggle input:checked + .slider:before { transform: translateX(16px); }

/* ── Service Checks ───────────────────────────────── */
.bp-service-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--portal-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}

.bp-service-check:hover { border-color: var(--portal-primary); background: #eff6ff; }
.bp-service-check.checked { border-color: var(--portal-primary); background: #eff6ff; }

.bp-service-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.bp-service-check-label { font-size: 13px; font-weight: 500; }
.bp-check-tick { color: var(--portal-primary); font-weight: 700; }

/* ── Empty State ──────────────────────────────────── */
.bp-empty-portal {
  text-align: center;
  color: var(--portal-muted);
  font-size: 13px;
}

.bp-empty-portal > div:first-child { font-size: 36px; margin-bottom: 8px; }

/* ── Login Page ───────────────────────────────────── */
.bp-portal-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  padding: 20px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.bp-portal-login-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.bp-portal-login-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  padding: 32px 28px;
  text-align: center;
  color: #fff;
}

.bp-portal-logo {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.bp-portal-login-header h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}

.bp-portal-login-header p {
  font-size: 13px;
  opacity: .85;
  margin: 0;
}

.bp-portal-login-form {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bp-input-icon-wrap { position: relative; }

.bp-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.bp-input-with-icon { padding-left: 38px; }

.bp-portal-login-footer {
  padding: 16px 28px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--portal-muted);
}

.bp-portal-login-footer a { color: var(--portal-primary); text-decoration: none; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .bp-portal-sidebar {
    display: none;
  }
  .bp-portal-main > * { margin: 12px 16px; }
  .bp-portal-topbar { padding: 16px 16px 0; }
  .bp-portal-grid-2 { grid-template-columns: 1fr; margin: 0 16px; }
  .bp-portal-stats { grid-template-columns: 1fr 1fr; }
  .bp-sched-row { grid-template-columns: 44px 1fr; }
  .bp-sched-day { grid-column: 1 / -1; }
  .bp-portal-table { font-size: 12px; }
  .bp-portal-table th, .bp-portal-table td { padding: 8px 10px; }
}
