/* ============================================================
   OH Theme Management — dashboard-ui.css v1.0.0
   Dashboard UI Improvements: Breathing Space, Mobile Redesign,
   Tab Navigation, Responsive Layout, UI Consistency
   Tasks: 2, 3, 4, 5, 6
   ============================================================ */

/* ══════════════════════════════════════════════════════════════
   TASK 2 — DASHBOARD BREATHING SPACE
   Card padding, spacing, vertical rhythm
   ══════════════════════════════════════════════════════════════ */

/* Reusable card component structure */
.otm-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
}

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

.otm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 20px 32px;
  border-bottom: 1px solid #f3f4f6;
  flex-wrap: wrap;
}

.otm-card-header__title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  margin: 0;
}

.otm-card-header__action {
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: #6366f1;
  text-decoration: none;
  transition: color .15s;
}

.otm-card-header__action:hover {
  color: #4f46e5;
}

.otm-card-body {
  padding: 32px;
}

/* Dashboard section cards — improved spacing */
.otm-account-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
}

.otm-account-section:last-child {
  margin-bottom: 0;
}

/* Section header inside card — proper padding */
.otm-account-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 20px 32px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.otm-account-section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  margin-bottom: 0;
}

/* Quick action grid — proper card body padding */
.otm-account-section > .otm-account-grid {
  /* Grid is flush (1px gap lines); section provides the container */
}

/* Empty state: generous breathing room */
.otm-account-empty-state {
  padding: 48px 32px;
  text-align: center;
}

/* Welcome banner: consistent vertical padding */
.otm-account-welcome {
  padding: 32px;
  margin-bottom: 24px;
}

/* Stats grid: proper gap between cards */
.otm-account-stats-grid {
  gap: 16px;
  margin-bottom: 24px;
}

/* Stat card: internal breathing space */
.otm-account-stat-card {
  padding: 20px 20px 18px;
}

/* ── Action card body padding ──────────────────────────────── */
.otm-account-card {
  padding: 24px 24px 48px; /* extra bottom for arrow */
}

.otm-account-card__icon {
  margin-bottom: 14px;
}

.otm-account-card__title {
  margin-bottom: 6px;
}

/* ══════════════════════════════════════════════════════════════
   TASK 3 — MOBILE ACCOUNT UI REDESIGN
   Profile header card + grouped settings sections
   ══════════════════════════════════════════════════════════════ */

/* Mobile profile header card */
.otm-mobile-profile-card {
  display: none; /* visible only on mobile */
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 24px 20px;
  margin-bottom: 16px;
  align-items: center;
  gap: 16px;
}

.otm-mobile-profile-card .otm-account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.otm-mobile-profile-card__info {
  flex: 1;
  min-width: 0;
}

.otm-mobile-profile-card__name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.otm-mobile-profile-card__email {
  font-family: 'DM Sans', sans-serif;
  font-size: .78rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.4;
}

.otm-mobile-profile-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ── Reusable list item component ──────────────────────────── */
.otm-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: #fff;
  text-decoration: none;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  transition: background .12s;
  position: relative;
  cursor: pointer;
}

.otm-list-item:last-child {
  border-bottom: none;
}

.otm-list-item:hover {
  background: #fafafe;
}

.otm-list-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #eef2ff;
  color: #6366f1;
}

.otm-list-item__icon--indigo { background: #eef2ff; color: #6366f1; }
.otm-list-item__icon--blue   { background: #eff6ff; color: #3b82f6; }
.otm-list-item__icon--violet { background: #f5f3ff; color: #8b5cf6; }
.otm-list-item__icon--amber  { background: #fffbeb; color: #f59e0b; }
.otm-list-item__icon--green  { background: #f0fdf4; color: #059669; }
.otm-list-item__icon--red    { background: #fef2f2; color: #ef4444; }
.otm-list-item__icon--gray   { background: #f9fafb; color: #6b7280; }

.otm-list-item__body {
  flex: 1;
  min-width: 0;
}

.otm-list-item__title {
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.otm-list-item__desc {
  font-family: 'DM Sans', sans-serif;
  font-size: .75rem;
  color: #9ca3af;
  margin-top: 1px;
  line-height: 1.3;
}

.otm-list-item--danger .otm-list-item__title { color: #ef4444; }

.otm-list-item__chevron {
  color: #d1d5db;
  flex-shrink: 0;
  transition: transform .15s;
}

.otm-list-item:hover .otm-list-item__chevron {
  transform: translateX(3px);
  color: #6366f1;
}

.otm-list-item__control {
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Mobile settings section group ─────────────────────────── */
.otm-mobile-section-group {
  display: none; /* visible only on mobile */
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}

.otm-mobile-section-group:last-child {
  margin-bottom: 0;
}

.otm-mobile-section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .67rem;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 14px 20px 8px;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
}

/* ── Toggle switch (reusable) ───────────────────────────────── */
.otm-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.otm-toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.otm-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.otm-toggle-switch__slider {
  position: absolute;
  inset: 0;
  background: #e5e7eb;
  border-radius: 100px;
  cursor: pointer;
  transition: background .25s;
}

.otm-toggle-switch__slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.otm-toggle-switch input:checked + .otm-toggle-switch__slider {
  background: #6366f1;
}

.otm-toggle-switch input:checked + .otm-toggle-switch__slider::before {
  transform: translateX(18px);
}

/* ── Avatar component ───────────────────────────────────────── */
.otm-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  border-radius: 12px;
  letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
  flex-shrink: 0;
}

.otm-avatar--sm  { width: 32px; height: 32px; font-size: .75rem; border-radius: 8px; }
.otm-avatar--md  { width: 44px; height: 44px; font-size: 1rem;   border-radius: 12px; }
.otm-avatar--lg  { width: 56px; height: 56px; font-size: 1.15rem; border-radius: 16px; }
.otm-avatar--xl  { width: 72px; height: 72px; font-size: 1.4rem;  border-radius: 20px; }

/* ══════════════════════════════════════════════════════════════
   TASK 4 — MOBILE NAVIGATION: SCROLLABLE TOP TAB NAV
   ══════════════════════════════════════════════════════════════ */

.otm-mobile-tabs {
  display: none; /* shown at ≤768px */
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 0 16px;
  gap: 4px;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.otm-mobile-tabs::-webkit-scrollbar {
  display: none;
}

.otm-mobile-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}

.otm-mobile-tab:hover {
  color: #6366f1;
}

.otm-mobile-tab-active,
.otm-mobile-tab.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

.otm-mobile-tab svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: .7;
  transition: opacity .15s;
}

.otm-mobile-tab-active svg,
.otm-mobile-tab.active svg,
.otm-mobile-tab:hover svg {
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════════
   TASK 5 — RESPONSIVE DESIGN: DESKTOP / TABLET / MOBILE
   ══════════════════════════════════════════════════════════════ */

/* ── Desktop: sidebar + content layout (already in auth.css,
   but we reinforce with correct padding values) ─────────────── */

.otm-account-main {
  padding: 32px 32px 64px;
  min-width: 0;
}

/* ── Tablet: 768–1024px — collapsible sidebar ───────────────── */
@media (max-width: 1024px) and (min-width: 769px) {
  .otm-account-layout {
    grid-template-columns: 220px 1fr;
  }

  .otm-account-main {
    padding: 24px 24px 48px;
  }

  .otm-card-header {
    padding: 16px 24px;
  }

  .otm-card-body {
    padding: 24px;
  }

  .otm-account-section-header {
    padding: 16px 24px;
  }

  .otm-account-welcome {
    padding: 24px;
  }

  .otm-account-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Mobile: ≤768px — stack layout (mobile-nav.css handles tab/list nav) ── */
@media (max-width: 768px) {

  /* NOTE: .otm-mobile-tabs is hidden by mobile-nav.css (replaced by .otm-mobile-nav) */

  /* Show mobile profile card in place of sidebar user block */
  .otm-mobile-profile-card {
    display: flex;
    margin: 12px 12px 0;
  }

  /* Show mobile section groups (used in account settings mobile view) */
  .otm-mobile-section-group {
    display: block;
  }

  /* Reduce main padding */
  .otm-account-main {
    padding: 16px 12px 48px;
  }

  /* Card body: tighter on mobile */
  .otm-card-body {
    padding: 20px;
  }

  .otm-card-header {
    padding: 14px 20px;
  }

  .otm-account-section-header {
    padding: 14px 20px;
  }

  .otm-account-empty-state {
    padding: 32px 20px;
  }

  .otm-account-welcome {
    padding: 20px;
    margin-bottom: 16px;
  }

  .otm-account-stats-grid {
    gap: 10px;
    margin-bottom: 16px;
  }

  .otm-account-section {
    margin-bottom: 16px;
    border-radius: 12px;
  }

  .otm-account-stat-card {
    padding: 14px;
  }

  /* Mobile account-card */
  .otm-account-card {
    padding: 16px 16px 44px;
  }
}

/* ── Small phones: ≤480px ───────────────────────────────────── */
@media (max-width: 480px) {

  .otm-account-main {
    padding: 12px 10px 40px;
  }

  .otm-mobile-profile-card {
    margin: 10px 10px 0;
    padding: 16px;
  }

  .otm-account-stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .otm-account-grid {
    grid-template-columns: 1fr;
  }

  .otm-card-body {
    padding: 16px;
  }

  .otm-card-header {
    padding: 12px 16px;
  }

  .otm-account-section-header {
    padding: 12px 16px;
  }

  .otm-account-welcome {
    padding: 16px;
    border-radius: 12px;
  }

  .otm-account-section {
    border-radius: 10px;
  }
}

/* ══════════════════════════════════════════════════════════════
   TASK 6 — UI CONSISTENCY: REUSABLE COMPONENTS
   Cards, Buttons, Inputs, List Items, Alerts
   ══════════════════════════════════════════════════════════════ */

/* ── Form group (dashboard context) ────────────────────────── */
.otm-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}

.otm-form-group + .otm-form-group {
  margin-top: 16px;
}

/* ── Consistent button sizes ────────────────────────────────── */
.otm-btn {
  border-radius: 10px;
  font-size: .88rem;
  padding: .65rem 1.4rem;
  letter-spacing: .01em;
}

.otm-btn--sm {
  padding: .45rem .9rem;
  font-size: .78rem;
  border-radius: 8px;
}

.otm-btn--lg {
  padding: .85rem 1.85rem;
  font-size: .95rem;
  border-radius: 12px;
}

/* ── Alert component ────────────────────────────────────────── */
.otm-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 16px;
}

.otm-alert--info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.otm-alert--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #065f46; }
.otm-alert--warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.otm-alert--error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.otm-alert__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.otm-alert__body { flex: 1; min-width: 0; }
.otm-alert__title { font-weight: 700; margin-bottom: 2px; }
.otm-alert__desc  { font-size: .82rem; opacity: .8; }

/* ── Status badge ───────────────────────────────────────────── */
.otm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: .2rem .65rem;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.otm-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}

.otm-status-badge--active  { background: #d1fae5; color: #065f46; }
.otm-status-badge--pending { background: #fef3c7; color: #92400e; }
.otm-status-badge--expired { background: #f3f4f6; color: #6b7280; }
.otm-status-badge--error   { background: #fef2f2; color: #991b1b; }

/* ── Page section label ─────────────────────────────────────── */
.otm-page-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .67rem;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

/* ── Dashboard section spacing ──────────────────────────────── */
.otm-dashboard-section {
  margin-bottom: 24px;
}

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

.otm-dashboard-section__heading {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
  line-height: 1.3;
}

/* ── Divider ────────────────────────────────────────────────── */
.otm-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 24px 0;
}

/* ── Auth left panel: visual balance after stats removal ─────── */
/* Re-space feat-list to distribute available space */
.otm-auth-feat-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .95rem;
  padding-block: 0.5rem;
  margin-bottom: 2rem;
}

.otm-auth-feat {
  display: flex;
  align-items: center;
  gap: .85rem;
  color: rgba(255,255,255,.88);
  font-size: .93rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  padding: .5rem 0;
}

.otm-auth-feat-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: rgba(255,255,255,.12);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.15);
  font-size: 1.1rem;
}

/* Tighten headline to compensate for removed stats */
.otm-auth-headline {
  margin-bottom: 1rem;
}

.otm-auth-subline {
  margin-bottom: 2rem;
}

/* Stats row stays but gets more top breathing space */
.otm-auth-stats {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.12);
}

/* ══════════════════════════════════════════════════════════════
   MOBILE NAV SIDEBAR: hide user block, show mobile tab nav
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Hide the sidebar user identity block — replaced by mobile profile card */
  .otm-account-user {
    display: none;
  }

  /* Hide the text sidebar nav entirely on mobile */
  .otm-account-nav {
    display: none;
  }

  /* Hide sidebar labels */
  .otm-sidebar-label {
    display: none;
  }

  /* Sidebar is hidden by mobile-nav.css via display:none; these resets ensure no layout bleed */
  .otm-account-sidebar {
    position: static;
    min-height: auto;
    max-height: none;
    border-right: none;
    border-bottom: none;
    padding: 0;
    background: transparent;
    overflow: visible;
  }
}

/* ── Mobile tab logout style ────────────────────────────────── */
.otm-mobile-tab--logout {
  color: #ef4444;
  margin-left: auto;
}

.otm-mobile-tab--logout:hover {
  color: #dc2626;
}



.otm-account-sidebar,
.otm-mobile-tabs {
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

.otm-account-sidebar::-webkit-scrollbar,
.otm-mobile-tabs::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.otm-account-sidebar::-webkit-scrollbar-track,
.otm-mobile-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.otm-account-sidebar::-webkit-scrollbar-thumb,
.otm-mobile-tabs::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 4px;
}
