/* =============================================================================
   DocuCore — My Account Dashboard
   Shortcode: [docucore_dashboard]
   ============================================================================= */

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.dp-dashboard {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 0 48px;
  font-family: inherit;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.dp-dashboard__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 0 22px;
  border-bottom: 1px solid #e8eaed;
  margin-bottom: 28px;
}
.dp-dashboard__avatar img { border-radius: 50%; display: block; }
.dp-dashboard__user-info  { display: flex; flex-direction: column; gap: 6px; }
.dp-dashboard__name { font-size: 20px; font-weight: 700; margin: 0; color: #111; line-height: 1.2; }

/* ── Stat cards ───────────────────────────────────────────────────────────── */
.dp-dashboard__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
@media (max-width: 720px) { .dp-dashboard__stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .dp-dashboard__stats { grid-template-columns: 1fr; } }

.dp-stat-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: box-shadow .18s, border-color .18s, transform .15s;
  position: relative;
}
.dp-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: #d0d5dd; }

/* Clickable stat cards scroll to + activate matching tab */
.dp-stat-card--clickable { cursor: pointer; user-select: none; }
.dp-stat-card--clickable:hover { border-color: #0096B7; box-shadow: 0 4px 16px rgba(0,150,183,.12); }
.dp-stat-card--clickable:hover .dp-stat-card__num { color: #0096B7; }
.dp-stat-card--clickable:active { transform: scale(.98); }
.dp-stat-card--clickable:focus-visible { outline: 2px solid #0096B7; outline-offset: 2px; }

.dp-stat-card__arrow {
  position: absolute; top: 12px; right: 14px;
  font-size: 18px; color: #c0cad4; line-height: 1;
  transition: color .15s, transform .15s;
}
.dp-stat-card--clickable:hover .dp-stat-card__arrow { color: #0096B7; transform: translateX(2px); }

.dp-stat-card__icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.dp-stat-card__body { flex: 1; min-width: 0; }

.dp-stat-card__num {
  font-size: 22px; font-weight: 800; color: #111;
  line-height: 1.1; letter-spacing: -.5px;
  transition: color .15s;
}

.dp-stat-card__label {
  font-size: 11.5px; color: #8a94a6; margin-top: 3px; line-height: 1.4;
}

.dp-stat-card--plan .dp-stat-card__num {
  font-size: 18px; font-weight: 800; text-transform: capitalize; letter-spacing: -.3px;
}

.dp-stat-card__expiry { font-size: 11px; color: #8a94a6; margin-top: 5px; }
.dp-stat-card__expiry--soon { color: #d97706; font-weight: 600; }

.dp-stat-card__upgrade {
  display: inline-block; margin-top: 8px;
  font-size: 11px; font-weight: 600; color: #0096B7; text-decoration: none;
  border: 1px solid #0096B730; border-radius: 4px; padding: 2px 8px;
  background: #0096B708; transition: background .15s, border-color .15s;
}
.dp-stat-card__upgrade:hover { background: #0096B715; border-color: #0096B7; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.dp-dashboard__tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid #e8eaed;
  margin-bottom: 20px;
}

.dp-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; color: #6b7280;
  transition: color .15s, border-color .15s; white-space: nowrap;
}
.dp-tab:hover { color: #0096B7; }
.dp-tab--active { color: #0096B7; border-bottom-color: #0096B7; }
.dp-tab:focus-visible { outline: 2px solid #0096B7; outline-offset: -2px; border-radius: 4px 4px 0 0; }

.dp-tab__count {
  background: #f0f2f5; color: #6b7280;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  transition: background .15s, color .15s;
}
.dp-tab--active .dp-tab__count { background: #e0f3f9; color: #0096B7; }

/* ── Panels ───────────────────────────────────────────────────────────────── */
/* FIX: visibility controlled by CSS class only — no HTML hidden attribute */
.dp-dashboard__panel         { display: none; }
.dp-dashboard__panel--active { display: block; }

.dp-dashboard__empty {
  text-align: center; padding: 48px 24px;
  color: #8a94a6; font-size: 14px; line-height: 1.6;
}
.dp-dashboard__login-prompt {
  text-align: center; padding: 40px 24px; font-size: 15px; color: #555;
}
.dp-dashboard__login-prompt a { color: #0096B7; }

/* ── Document list ────────────────────────────────────────────────────────── */
/* FIX: was gap:1px + margin-bottom:8px — double-spaced. Now single gap:8px. */
.dp-doc-list { display: flex; flex-direction: column; gap: 8px; }

.dp-doc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; background: #fff;
  border: 1px solid #e8eaed; border-radius: 10px;
  transition: box-shadow .15s, border-color .15s;
}
.dp-doc-item:hover { box-shadow: 0 3px 12px rgba(0,0,0,.07); border-color: #d0d5dd; }

/* ── Thumbnail ────────────────────────────────────────────────────────────── */
.dp-doc-item__thumb {
  width: 48px; height: 64px; flex-shrink: 0;
  border-radius: 5px; overflow: hidden;
  background: #f5f6f8; border: 1px solid #e8eaed;
}
/* FIX: was object-fit:cover (crops document pages). Now contain+white. */
.dp-doc-item__thumb img {
  width: 100%; height: 100%;
  object-fit: contain; background: #fff; display: block;
}
.dp-doc-item__placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #0096B7;
  letter-spacing: .05em;
  background: linear-gradient(135deg, #e0f3f9, #f0fafd);
}

/* ── Document info ────────────────────────────────────────────────────────── */
.dp-doc-item__info { flex: 1; min-width: 0; }

.dp-doc-item__title {
  font-size: 14px; font-weight: 600; color: #111827; text-decoration: none;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4; margin-bottom: 5px;
}
.dp-doc-item__title:hover { color: #0096B7; }

.dp-doc-item__meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px; font-size: 11.5px; color: #8a94a6;
}

.dp-doc-item__cat      { color: #6b7280; font-weight: 500; }
.dp-doc-item__pages    { color: #9ca3af; }
.dp-doc-item__activity { color: #9ca3af; font-size: 11px; }

/* ── File-type badges ─────────────────────────────────────────────────────── */
/* FIX: file-type variants were missing — badges were unstyled in doc rows */
.dp-badge--filetype {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; text-transform: uppercase;
  letter-spacing: .04em; border: 1px solid transparent;
}
.dp-badge--pdf          { background: #fde8e8; color: #b91c1c; border-color: #fca5a5; }
.dp-badge--docx,
.dp-badge--doc          { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.dp-badge--pptx,
.dp-badge--ppt          { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.dp-badge--xlsx,
.dp-badge--xls          { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.dp-badge--txt          { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.dp-badge--epub         { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }

/* ── Open button ──────────────────────────────────────────────────────────── */
.dp-doc-item__open {
  display: inline-flex; align-items: center; gap: 5px;
  flex-shrink: 0; padding: 6px 12px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 7px; font-size: 12px; font-weight: 600;
  color: #374151; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.dp-doc-item__open:hover { background: #0096B7; border-color: #0096B7; color: #fff; }

@media (max-width: 480px) {
  .dp-doc-item__open-label { display: none; }
  .dp-doc-item__open { padding: 8px; border-radius: 8px; }
}

/* ── Tier badge (header) ──────────────────────────────────────────────────── */
.dp-tier-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .03em;
}
.dp-tier-badge--free    { background: #f1f5f9; color: #64748b; }
.dp-tier-badge--pro     { background: #e0f3f9; color: #0096B7; }
.dp-tier-badge--premium { background: #ede9fe; color: #7c3aed; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .dp-dashboard__header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dp-tab { padding: 9px 12px; font-size: 13px; gap: 5px; }
  .dp-doc-item { gap: 10px; padding: 10px 12px; }
  .dp-doc-item__thumb { width: 40px; height: 54px; }
}

/* ── Nav-menu badge (injected by ProfileMenu) ─────────────────────────────── */
.docucore-library-nav .dp-nav-badge {
  display: inline-block;
  background: #0096B7;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 5px;
  vertical-align: middle;
}

/* ── [docucore_my_library_link] shortcode ────────────────────────────────── */
.dp-library-link {
  color: #0096B7;
  text-decoration: none;
  font-weight: 600;
}
.dp-library-link:hover { text-decoration: underline; }

.dp-library-link__count {
  display: inline-block;
  background: #0096B7;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1.4;
}

.dp-library-link--btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0096B7;
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .15s;
}
.dp-library-link--btn:hover { background: #0078a0; }
.dp-library-link--btn .dp-library-link__count {
  background: rgba(255,255,255,.25);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   My Profile Panel
   ═══════════════════════════════════════════════════════════════════════════ */

.dp-profile-panel {
  padding: 4px 0 8px;
}

/* Hero row — avatar + name */
.dp-profile-panel__hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px 20px;
  background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%);
  border: 1px solid #eef0f3;
  border-radius: 12px;
  margin-bottom: 20px;
}
.dp-profile-panel__avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  display: block;
}
.dp-profile-panel__hero-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dp-profile-panel__name {
  font-size: 20px;
  font-weight: 800;
  color: #111;
  margin: 0;
  letter-spacing: -.3px;
}
.dp-profile-panel__expiry {
  font-size: 12px;
  color: #888;
}
.dp-profile-panel__expiry--warn {
  color: #d97706;
  font-weight: 600;
}

/* Info grid */
.dp-profile-panel__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .dp-profile-panel__grid { grid-template-columns: 1fr; }
}

.dp-profile-panel__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fafbfc;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  padding: 12px 14px;
}
.dp-profile-panel__field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #aaa;
}
.dp-profile-panel__field-value {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  word-break: break-word;
}

/* Actions row */
.dp-profile-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dp-profile-panel__action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.dp-profile-panel__action-btn:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}
.dp-profile-panel__action-btn--upgrade {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde68a;
}
.dp-profile-panel__action-btn--upgrade:hover {
  background: #fef08a;
}
.dp-profile-panel__action-btn--logout {
  background: #fff;
  color: #dc2626;
  border-color: #fecaca;
  margin-left: auto;
}
.dp-profile-panel__action-btn--logout:hover {
  background: #fef2f2;
}

/* ── CHANGE PASSWORD FORM ─────────────────────────────────────────────────── */
.dp-profile-panel__section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}
.dp-profile-panel__section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin: 0 0 14px;
}
.dp-password-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}
.dp-password-form__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dp-password-form__row label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}
.dp-password-form__input {
  padding: 8px 11px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
  width: 100%;
}
.dp-password-form__input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,.15);
}
.dp-password-form__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.dp-profile-panel__action-btn--save-pw {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
.dp-profile-panel__action-btn--save-pw:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}
.dp-password-form__msg {
  font-size: 12.5px;
  font-style: italic;
}
.dp-password-form__msg--success { color: #16a34a; }
.dp-password-form__msg--error   { color: #dc2626; }

/* ── Profile edit form additions ──────────────────────────────────────────── */
.dp-password-form__input--readonly {
  background: #f8fafc;
  color: #9ca3af;
  cursor: not-allowed;
  border-color: #e8eaed;
}
.dp-password-form__input--readonly:focus {
  border-color: #e8eaed;
  box-shadow: none;
  outline: none;
}

/* Upgrade link in plan field */
.dp-profile-panel__field-value .dp-stat-card__upgrade {
  vertical-align: middle;
}

/* Profile form section spacing */
.dp-profile-panel__section + .dp-profile-panel__section {
  margin-top: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   My Profile Panel — two-column layout (matches design screenshot)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hero — extend to show Member Since + Activity on the right */
.dp-profile-panel__hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%);
  border: 1px solid #eef0f3;
  border-radius: 12px;
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .dp-profile-panel__hero { grid-template-columns: auto 1fr; }
  .dp-profile-panel__hero-meta { grid-column: 1 / -1; margin-top: 12px; }
}

.dp-profile-panel__hero-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 200px;
  border-left: 1px solid #eef0f3;
  padding-left: 20px;
}
.dp-profile-panel__hero-meta-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dp-profile-panel__meta-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #aab0bb;
}
.dp-profile-panel__meta-value {
  font-size: 13.5px;
  font-weight: 600;
  color: #222;
}

/* Two-column body */
.dp-profile-panel__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .dp-profile-panel__columns { grid-template-columns: 1fr; }
}
.dp-profile-panel__col { display: flex; flex-direction: column; gap: 16px; }

/* Card — wraps each section in the columns */
.dp-profile-panel__card {
  background: #fafbfc;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 18px 20px;
  flex: 1;
}

/* Subscription plan row */
.dp-profile-plan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.dp-profile-plan-expiry { font-size: 12px; color: #888; margin: 0 0 6px; }
.dp-profile-plan-expiry--warn { color: #d97706; font-weight: 600; }
.dp-profile-plan-desc { font-size: 12.5px; color: #666; margin: 4px 0 0; line-height: 1.5; }

/* Upgrade button variant in plan card */
.dp-stat-card__upgrade--btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #0096B7;
  border: 1px solid #0096B740;
  border-radius: 6px;
  background: #e8f8fc;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.dp-stat-card__upgrade--btn:hover { background: #c9eef8; border-color: #0096B7; }

/* Footer actions (sign out) */
.dp-profile-panel__actions--footer {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

/* Remove old duplicate section border from first card */
.dp-profile-panel__card + .dp-profile-panel__card { margin-top: 0; }
.dp-profile-panel__section { margin-top: 0; padding-top: 0; border-top: none; }

/* Password form inside card needs no extra top spacing */
.dp-profile-panel__card .dp-password-form { max-width: 100%; }

/* ── Plan Features list in Profile Panel ──────────────────────────────────── */
.dp-profile-plan-features {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dp-profile-plan-features li {
  font-size: 12px;
  color: #555;
  padding: 2px 0;
}
.dp-profile-plan-feature--no { color: #9ca3af; }

/* ── Profile Avatar Upload ────────────────────────────────────────────────── */
.dp-avatar-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
}
.dp-avatar-wrap img {
    display: block;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    transition: filter 0.2s;
}
.dp-avatar-wrap:hover img {
    filter: brightness(0.82);
}
.dp-avatar-edit {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #0073aa;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    transition: background 0.15s;
}
.dp-avatar-edit:hover { background: #005177; }
.dp-avatar-edit svg { pointer-events: none; }
.dp-avatar-file-input {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0; overflow: hidden;
    clip: rect(0,0,0,0);
}
.dp-avatar-status {
    display: block;
    font-size: 11px;
    margin-top: 4px;
    text-align: center;
    color: #666;
    min-height: 16px;
}
