/* ==========================================================
   Doctor Dashboard
   Shared shell (bottom tab bar on mobile, side rail from tablet up)
   plus the home overview and the five sub-pages (queue, patients,
   messages, finance, settings). Built entirely from tokens.css.
   ========================================================== */

:root {
  --dash-nav-h: 64px;
  --dash-rail-w: 232px;
}

/* ===== Shell =========================================================== */
.doctor-dashboard {
  min-height: 100dvh;
  background: var(--color-bg-soft);
}

.doctor-dashboard__content {
  /* Mobile padding: Top = --space-4, Left/Right = --space-3 (or --space-2) */
  padding: var(--space-4) var(--space-3)
    calc(var(--dash-nav-h) + env(safe-area-inset-bottom, 0px) + var(--space-6));
  
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  animation: dash-fade-in var(--duration-medium) var(--ease-out);
}

@keyframes dash-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ===== Bottom tab bar (mobile, default) ================================ */
.doctor-bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--color-line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.doctor-bottom-nav__item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: var(--dash-nav-h);
  padding: 0;
  background: transparent;
  border: none;
  color: var(--color-ink-faint);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.doctor-bottom-nav__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 28px;
  height: 3px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--color-primary);
  transform: translateX(-50%) scaleX(0);
  transition: transform var(--duration-fast) var(--ease-out);
}

.doctor-bottom-nav__item--active {
  color: var(--color-primary);
}

.doctor-bottom-nav__item--active::before {
  transform: translateX(-50%) scaleX(1);
}

.doctor-bottom-nav__item:hover {
  color: var(--color-primary-dark);
}

.doctor-bottom-nav__icon {
  width: 21px;
  height: 21px;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  flex: none;
}

.doctor-bottom-nav__label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ===== Icon glyphs (CSS mask, tint via currentColor) ==================== */
.icon-house { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11.5 12 4l8 7.5'/%3E%3Cpath d='M6 10.5V19a1 1 0 0 0 1 1h4v-6h2v6h4a1 1 0 0 0 1-1v-8.5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11.5 12 4l8 7.5'/%3E%3Cpath d='M6 10.5V19a1 1 0 0 0 1 1h4v-6h2v6h4a1 1 0 0 0 1-1v-8.5'/%3E%3C/svg%3E"); }

.icon-clipboard { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2'/%3E%3Cpath d='M9 4V3.5A1.5 1.5 0 0 1 10.5 2h3A1.5 1.5 0 0 1 15 3.5V4'/%3E%3Cpath d='M8.5 11.5h7M8.5 15.5h7'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2'/%3E%3Cpath d='M9 4V3.5A1.5 1.5 0 0 1 10.5 2h3A1.5 1.5 0 0 1 15 3.5V4'/%3E%3Cpath d='M8.5 11.5h7M8.5 15.5h7'/%3E%3C/svg%3E"); }

.icon-people { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8.2' r='3'/%3E%3Cpath d='M3.3 19.5c0-3.4 2.6-6 5.9-6h1.6c3.3 0 5.9 2.6 5.9 6'/%3E%3Ccircle cx='17.2' cy='9.3' r='2.2'/%3E%3Cpath d='M15.6 13.6c2.5.5 4.3 2.7 4.3 5.4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8.2' r='3'/%3E%3Cpath d='M3.3 19.5c0-3.4 2.6-6 5.9-6h1.6c3.3 0 5.9 2.6 5.9 6'/%3E%3Ccircle cx='17.2' cy='9.3' r='2.2'/%3E%3Cpath d='M15.6 13.6c2.5.5 4.3 2.7 4.3 5.4'/%3E%3C/svg%3E"); }

.icon-chat { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5.5h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-8.5l-4.2 3.6v-3.6H5a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5.5h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-8.5l-4.2 3.6v-3.6H5a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z'/%3E%3C/svg%3E"); }

.icon-wallet { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 7.2A2.2 2.2 0 0 1 5.7 5h12.6a1 1 0 0 1 1 1v2.4'/%3E%3Cpath d='M3.5 7.2v10.3a2 2 0 0 0 2 2h14a1 1 0 0 0 1-1V9.4a1 1 0 0 0-1-1H5.7a2.2 2.2 0 0 1-2.2-2.2z'/%3E%3Ccircle cx='17' cy='13.6' r='1.3' fill='%23000' stroke='none'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 7.2A2.2 2.2 0 0 1 5.7 5h12.6a1 1 0 0 1 1 1v2.4'/%3E%3Cpath d='M3.5 7.2v10.3a2 2 0 0 0 2 2h14a1 1 0 0 0 1-1V9.4a1 1 0 0 0-1-1H5.7a2.2 2.2 0 0 1-2.2-2.2z'/%3E%3Ccircle cx='17' cy='13.6' r='1.3' fill='%23000' stroke='none'/%3E%3C/svg%3E"); }

.icon-gear { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='2.8'/%3E%3Cpath d='M12 3.5v2.7M12 17.8v2.7M20.5 12h-2.7M6.2 12H3.5M17.9 6.1l-1.9 1.9M7.9 16.1l-1.9 1.9M17.9 17.9l-1.9-1.9M7.9 7.9 6.1 6.1'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='2.8'/%3E%3Cpath d='M12 3.5v2.7M12 17.8v2.7M20.5 12h-2.7M6.2 12H3.5M17.9 6.1l-1.9 1.9M7.9 16.1l-1.9 1.9M17.9 17.9l-1.9-1.9M7.9 7.9 6.1 6.1'/%3E%3C/svg%3E"); }

/* ===== Side rail (tablet and up) ======================================= */
@media (min-width: 900px) {

  .doctor-dashboard {
    display: block;
  }

  .doctor-bottom-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--dash-rail-w);
    height: 100vh;
    z-index: 100;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: var(--space-1);

    padding: var(--space-6) var(--space-3);

    border-top: none;
    border-right: 1px solid var(--color-line);
    background: var(--color-white);
  }

  .doctor-dashboard__content {
    margin-left: var(--dash-rail-w);
    padding: var(--space-8) var(--space-7);
    max-width: 880px;
  }

  .doctor-bottom-nav__item {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-3);
    height: auto;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
  }

  .doctor-bottom-nav__item:hover {
    background: var(--color-primary-soft);
  }

  .doctor-bottom-nav__item--active {
    background: var(--color-primary-soft);
  }

  .doctor-bottom-nav__item::before {
    top: 50%;
    left: 0;
    width: 3px;
    height: 22px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transform: translateY(-50%) scaleY(0);
  }

  .doctor-bottom-nav__item--active::before {
    transform: translateY(-50%) scaleY(1);
  }

  .doctor-bottom-nav__label {
    font-size: var(--step-small);
  }
}

/* ===== Dashboard home ==================================================== */
.dashboard-section {
  margin-bottom: var(--space-6);
}

/* ===== Dashboard Hero ===================================== */

.dashboard-header {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-primary-dark)
  );
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-card);
  color: var(--color-white);
}

.dashboard-greeting {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  padding-top: 5px;
}

.dashboard-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-white);
}

.dashboard-subtitle {
  margin-top: 4px;
  font-size: var(--step-small);
  color: rgba(255, 255, 255, 0.85);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (min-width: 560px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }
}

.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink-faint);
}

/* ===== Cards (subscription, verification, quick actions, activity) ====== */
.dashboard-card {
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.dashboard-card:last-child {
  margin-bottom: 0;
}

.dashboard-card > h3 {
  font-family: var(--font-body);
  font-size: var(--step-lead);
  font-weight: 600;
  color: var(--color-ink);
  margin: 0 0 var(--space-2);
}

.dashboard-card > h2 {
  font-family: var(--font-display);
  font-size: var(--step-h3);
  font-weight: 600;
  color: var(--color-ink);
  margin: 0 0 var(--space-2);
}

.dashboard-card > p {
  color: var(--color-ink-soft);
  margin: 0;
}

.dashboard-card > p + p {
  margin-top: var(--space-1);
}

.dashboard-muted {
  color: var(--color-ink-faint) !important;
  font-size: var(--step-small);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.quick-actions .btn {
  width: 100%;
  font-size: var(--step-small);
  padding: 0.85rem 1rem;
}

@media (min-width: 560px) {
  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== Sub-pages (queue, patients, messages, finance, settings) ========= */
.dashboard-page__title {
  font-family: var(--font-display);
  font-size: var(--step-h2);
  font-weight: 600;
  color: var(--color-ink);
  margin: 0 0 var(--space-5);
}

.dashboard-page .dashboard-card {
  text-align: left;
}
.dashboard-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

.dashboard-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.dashboard-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin: .4rem 0;
}
.settings-menu-card {
    width: 100%;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}

.settings-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.settings-menu-card__content {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.settings-menu-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-menu-card__icon span {
    width: 22px;
    height: 22px;
    background: currentColor;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
}

.settings-menu-card__text {
    flex: 1;
}

.settings-menu-card__text h3 {
    margin: 0 0 var(--space-1);
}

.settings-menu-card__arrow {
    font-size: 1.6rem;
    color: var(--color-ink-faint);
}
/* ==========================================================
   Doctor Profile Form
   ========================================================== */

.profile-card,
.settings-card {
    background: var(--color-white);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}

.profile-card h2,
.settings-card h2 {
    margin: 0 0 var(--space-4);
    font-family: var(--font-display);
    font-size: var(--step-h3);
    font-weight: 600;
    color: var(--color-ink);
}

/* ==========================================================
   Avatar
   ========================================================== */

.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.avatar-upload img {
    width: 110px;
    height: 110px;
    border-radius: 999px;
    object-fit: cover;
    border: 4px solid var(--color-primary-soft);
    box-shadow: var(--shadow-card);
}

.avatar-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-display);
}

.avatar-upload input[type=file] {
    display: none;
}

/* ==========================================================
   Forms
   ========================================================== */

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-4);
}

.form-label {
    margin-bottom: var(--space-2);
    font-size: var(--step-small);
    font-weight: 600;
    color: var(--color-ink);
}

.form-input,
.form-textarea {
    width: 100%;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    padding: .85rem 1rem;
    background: var(--color-white);
    font-size: 1rem;
    color: var(--color-ink);
    transition:
        border-color var(--duration-fast),
        box-shadow var(--duration-fast);
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-ink-faint);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* ==========================================================
   Two-column layout
   ========================================================== */

.input-group {
    display: grid;
    gap: var(--space-4);
}

@media (min-width: 700px) {

    .input-group {
        grid-template-columns: repeat(2,1fr);
    }

}

/* ==========================================================
   Checkbox
   ========================================================== */

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    margin-top: var(--space-2);
}

.form-checkbox input {
    margin-top: .2rem;
}

.form-checkbox label {
    color: var(--color-ink-soft);
    line-height: 1.5;
}

/* ==========================================================
   Buttons
   ========================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    border: none;
    border-radius: var(--radius-md);
    padding: .95rem 1.25rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background var(--duration-fast),
        transform var(--duration-fast),
        opacity var(--duration-fast);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary-line);
    color: var(--color-ink);
}

.btn-outline:hover {
    background: var(--color-bg-soft);
    border-color: var(--color-primary);
}

/* ==========================================================
   Sticky Save Bar
   ========================================================== */

.profile-actions {
    position: sticky;
    bottom: calc(var(--dash-nav-h) + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-line);
    padding-top: var(--space-4);
    margin-top: var(--space-6);
}

.profile-actions .btn {
    width: 100%;
}

@media (min-width:900px){

    .profile-actions{
        bottom:0;
    }

}

/* ==========================================================
   Spinner
   ========================================================== */

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: button-spin .8s linear infinite;
}

@keyframes button-spin {

    to {
        transform: rotate(360deg);
    }

}
.doctor-bottom-nav__icon-wrap {
  position: relative;
  display: inline-flex;
}

.doctor-bottom-nav__badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--color-white);
}
@media (max-width: 899px) {
  .doctor-dashboard__content {
    padding-top: calc(
      var(--space-4) +                    /* header padding-top */
      var(--safe-area-top) +              /* safe area */
      var(--space-6) +                    /* greeting/title space */
      140px                               /* approximate header height */
    );
  }
}
@media (max-width: 899px) {
  .doctor-dashboard .dashboard-header {
    position: fixed;
    inset: 0 0 auto 0;
    width: 100%;
    z-index: 51;
    margin: 0;

    height: 220px; /* taller than patient's 180px — see note below */

    padding-top: calc(var(--safe-area-top) + var(--space-6));
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    padding-bottom: var(--space-4);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  }

  /* doctor-dashboard.css */
   @media (max-width: 899px) {
     .doctor-dashboard__content {
       padding-top: calc(220px + var(--space-4));
     }
   }
   @media (max-width: 899px) {
  .doctor-dashboard .dashboard-header {
    display: flex;
    flex-direction: column;
    justify-content: center; /* vertically centers the whole cluster in the 220px box */
    gap: 4px;
  }

  /* gap now owns the spacing — zero out the old margins so they don't stack on top of it */
  .doctor-dashboard .dashboard-greeting {
    margin: 0;
    padding-top: 0;
  }

  .doctor-dashboard .dashboard-title {
    margin: 0;
  }

  .doctor-dashboard .dashboard-subtitle {
    margin-top: 0;
  }

  .doctor-dashboard .dashboard-hero-meta {
    margin-top: 6px;
    gap: 6px;
  }
}
