/* =========================================================
   Loftigo Cockpit — TailAdmin-inspired layout, LIGHT theme,
   Loftigo brand colors (yellow accent).
   Sits on top of loftigo.de style.css (--yellow etc).
   ========================================================= */

:root {
  --cockpit-sidebar-width: 270px;
  --cockpit-topbar-height: 68px;

  --cockpit-bg: #f4f5f7;
  --cockpit-surface: #ffffff;

  --cockpit-text: #111827;
  --cockpit-text-soft: #4b5563;
  --cockpit-muted: #6b7280;
  --cockpit-faint: #9ca3af;

  --cockpit-border: #e5e7eb;
  --cockpit-border-soft: #f0f1f3;
  --cockpit-hover: #f8f9fb;
  --cockpit-yellow-soft: #fff5dc;
  --cockpit-yellow-mid: #ffe9a8;

  --cockpit-shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --cockpit-shadow-md: 0 4px 16px rgba(16,24,40,.06);
}

/* =========================================================
   Body baseline (cockpit only loads this file)
   ========================================================= */
body {
  margin: 0;
  padding: 0 !important;
  background: var(--cockpit-bg);
  color: var(--cockpit-text);
  font-family: 'Outfit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   Shell layout
   ========================================================= */
.cockpit-shell {
  display: grid;
  grid-template-columns: var(--cockpit-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

/* =========================================================
   Sidebar — DARK (TailAdmin style), yellow accent
   ========================================================= */
:root {
  --cockpit-sidebar-bg:        #1c1c1c;
  --cockpit-sidebar-fg:        #d1d5db;
  --cockpit-sidebar-fg-strong: #ffffff;
  --cockpit-sidebar-muted:     rgba(255,255,255,.55);
  --cockpit-sidebar-faint:     rgba(255,255,255,.32);
  --cockpit-sidebar-border:    rgba(255,255,255,.08);
  --cockpit-sidebar-hover:     rgba(255,255,255,.05);
  --cockpit-sidebar-active-bg: rgba(228,158,0,.16);
}

.cockpit-sidebar {
  background: var(--cockpit-sidebar-bg);
  color: var(--cockpit-sidebar-fg);
  border-right: none;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
  z-index: 100;
}
.cockpit-sidebar::-webkit-scrollbar { width: 6px; }
.cockpit-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }

.cockpit-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--cockpit-sidebar-fg-strong);
  padding: 8px 8px 18px;
  border-bottom: 1px solid var(--cockpit-sidebar-border);
  margin-bottom: 12px;
}
.cockpit-sidebar__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--cockpit-yellow-soft);
  padding: 4px;
}
.cockpit-sidebar__brand-text {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -.02em;
  color: var(--cockpit-sidebar-fg-strong);
}

/* ---- Nav ---- */
.cockpit-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cockpit-nav__label {
  padding: 16px 12px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--cockpit-sidebar-faint);
  text-transform: uppercase;
}

.cockpit-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--cockpit-sidebar-fg);
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.cockpit-nav__item i {
  font-size: 18px;
  width: 20px;
  text-align: center;
  color: var(--cockpit-sidebar-muted);
  flex-shrink: 0;
}
.cockpit-nav__item:hover {
  background: var(--cockpit-sidebar-hover);
  color: var(--cockpit-sidebar-fg-strong);
}
.cockpit-nav__item:hover i {
  color: var(--cockpit-sidebar-fg-strong);
}
.cockpit-nav__item.is-active {
  background: var(--cockpit-sidebar-active-bg);
  color: var(--cockpit-sidebar-fg-strong);
  font-weight: 800;
}
.cockpit-nav__item.is-active i {
  color: var(--yellow, #e49e00);
}

/* ---- Collapsible groups (native <details>) ---- */
.cockpit-nav__group {
  margin: 0;
}
.cockpit-nav__group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  color: var(--cockpit-sidebar-fg);
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, color .15s;
  user-select: none;
}
.cockpit-nav__group-head::-webkit-details-marker,
.cockpit-nav__group-head::marker {
  display: none;
  content: '';
}
.cockpit-nav__group-head > i:first-of-type {
  font-size: 18px;
  width: 20px;
  text-align: center;
  color: var(--cockpit-sidebar-muted);
  flex-shrink: 0;
}
.cockpit-nav__group-head > span {
  flex: 1;
}
.cockpit-nav__chevron {
  font-size: 14px !important;
  color: var(--cockpit-sidebar-faint) !important;
  width: auto !important;
  transition: transform .2s ease;
}
.cockpit-nav__group[open] .cockpit-nav__chevron {
  transform: rotate(90deg);
}
.cockpit-nav__group-head:hover {
  background: var(--cockpit-sidebar-hover);
  color: var(--cockpit-sidebar-fg-strong);
}
.cockpit-nav__group-head:hover > i:first-of-type {
  color: var(--cockpit-sidebar-fg-strong);
}
.cockpit-nav__group[open] > .cockpit-nav__group-head {
  color: var(--cockpit-sidebar-fg-strong);
}
.cockpit-nav__group[open] > .cockpit-nav__group-head > i:first-of-type {
  color: var(--yellow, #e49e00);
}

.cockpit-nav__sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 0 8px 38px;
  position: relative;
}
.cockpit-nav__sub::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 4px;
  bottom: 8px;
  width: 1px;
  background: var(--cockpit-sidebar-border);
}
.cockpit-nav__subitem {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--cockpit-sidebar-muted);
  transition: background .15s, color .15s;
}
.cockpit-nav__subitem:hover {
  background: var(--cockpit-sidebar-hover);
  color: var(--cockpit-sidebar-fg-strong);
}
.cockpit-nav__subitem.is-active {
  background: var(--cockpit-sidebar-active-bg);
  color: var(--cockpit-sidebar-fg-strong);
  font-weight: 800;
}

/* ---- Sidebar user (bottom) ---- */
.cockpit-sidebar__user {
  margin-top: 14px;
  padding: 12px;
  border-top: 1px solid var(--cockpit-sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cockpit-sidebar__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  border: 2px solid var(--cockpit-sidebar-border);
}
.cockpit-sidebar__user-meta {
  flex: 1;
  min-width: 0;
}
.cockpit-sidebar__user-meta strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--cockpit-sidebar-fg-strong);
  font-weight: 800;
}
.cockpit-sidebar__user-meta small {
  display: block;
  font-size: 11px;
  color: var(--cockpit-sidebar-muted);
}
.cockpit-sidebar__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--cockpit-sidebar-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.cockpit-sidebar__logout:hover {
  background: rgba(220,38,38,.18);
  color: #fca5a5;
}

/* =========================================================
   Main + Topbar
   ========================================================= */
.cockpit-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cockpit-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--cockpit-topbar-height);
  background: var(--cockpit-surface);
  border-bottom: 1px solid var(--cockpit-border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}
.cockpit-topbar__menu {
  display: none;
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 24px;
  color: var(--cockpit-text);
  -webkit-tap-highlight-color: rgba(228,158,0,.2);
  position: relative;
  z-index: 60;
  padding: 0;
  touch-action: manipulation;
}
.cockpit-topbar__menu i { pointer-events: none; }
.cockpit-topbar__menu:hover,
.cockpit-topbar__menu:active {
  background: var(--cockpit-hover);
}

.cockpit-topbar__title {
  flex: 1;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -.02em;
  color: var(--cockpit-text);
}

.cockpit-topbar__right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cockpit-topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--cockpit-text-soft);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--cockpit-border);
  background: var(--cockpit-surface);
  transition: background .15s, color .15s;
}
.cockpit-topbar__link:hover {
  background: var(--cockpit-yellow-soft);
  color: var(--cockpit-text);
}

.cockpit-topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--cockpit-bg);
  border: 1px solid var(--cockpit-border);
}
.cockpit-topbar__user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}
.cockpit-topbar__user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.cockpit-topbar__user-meta strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--cockpit-text);
}
.cockpit-topbar__user-meta small {
  font-size: 11px;
  color: var(--cockpit-muted);
}

/* =========================================================
   Content area
   ========================================================= */
.cockpit-content {
  flex: 1;
  padding: 28px 32px 60px;
}
.cockpit-content > main:first-child {
  margin: -28px -32px 0;
  padding: 28px 32px 0;
}
.cockpit-content .container {
  max-width: none;
  padding: 0;
  width: 100%;
}

/* =========================================================
   Grid + cards
   ========================================================= */
.cockpit-grid {
  display: grid;
  gap: 18px;
}
.cockpit-grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.cockpit-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.cockpit-grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }

.cockpit-card {
  background: var(--cockpit-surface);
  border: 1px solid var(--cockpit-border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--cockpit-shadow-sm);
}
.cockpit-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}
.cockpit-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--cockpit-text);
}
.cockpit-card__link {
  font-size: 13px;
  color: var(--yellow, #e49e00);
  font-weight: 800;
  text-decoration: none;
}

/* ---- TailAdmin-style stat card ---- */
.cockpit-stat {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cockpit-stat__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cockpit-yellow-soft);
  color: var(--yellow, #e49e00);
  font-size: 22px;
}
.cockpit-stat__icon--blue {
  background: #e0ecff;
  color: #2563eb;
}
.cockpit-stat__icon--green {
  background: #dcfce7;
  color: #16a34a;
}
.cockpit-stat__icon--red {
  background: #fee2e2;
  color: #dc2626;
}
.cockpit-stat__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.cockpit-stat__main {
  flex: 1;
  min-width: 0;
}
.cockpit-stat__label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--cockpit-muted);
  margin-bottom: 4px;
}
.cockpit-stat__value {
  display: block;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--cockpit-text);
}
.cockpit-stat__trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
}
.cockpit-stat__trend--up {
  background: #dcfce7;
  color: #15803d;
}
.cockpit-stat__trend--down {
  background: #fee2e2;
  color: #b91c1c;
}
.cockpit-stat__trend--flat {
  background: var(--cockpit-bg);
  color: var(--cockpit-muted);
}

/* ---- Quick actions grid ---- */
.cockpit-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: 12px;
}
.cockpit-action {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--cockpit-bg);
  border: 1px solid var(--cockpit-border);
  text-decoration: none;
  color: var(--cockpit-text);
  transition: transform .15s, background .15s, border-color .15s;
}
.cockpit-action:hover {
  transform: translateY(-1px);
  background: var(--cockpit-yellow-soft);
  border-color: var(--cockpit-yellow-mid);
}
.cockpit-action__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--cockpit-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--yellow, #e49e00);
  flex-shrink: 0;
}
.cockpit-action__body { flex: 1; min-width: 0; }
.cockpit-action__title {
  display: block;
  font-weight: 800;
  margin-bottom: 2px;
  font-size: 14px;
}
.cockpit-action__sub {
  display: block;
  font-size: 12px;
  color: var(--cockpit-muted);
  line-height: 1.4;
}

/* ---- Tables ---- */
.cockpit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.cockpit-table th,
.cockpit-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--cockpit-border-soft);
}
.cockpit-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--cockpit-muted);
  font-weight: 800;
  background: var(--cockpit-bg);
}
.cockpit-table tbody tr:hover {
  background: var(--cockpit-hover);
}

/* =========================================================
   Footer (desktop only)
   ========================================================= */
.cockpit-footer {
  margin-top: auto;
  padding: 18px 32px;
  border-top: 1px solid var(--cockpit-border);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--cockpit-muted);
  background: var(--cockpit-surface);
  flex-wrap: wrap;
  gap: 8px;
}
.cockpit-footer a { color: inherit; text-decoration: none; }
.cockpit-footer a:hover { text-decoration: underline; }

/* =========================================================
   Login screen (centered, light)
   ========================================================= */
.cockpit-body--centered {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fafaf6 0%, #f0eee8 100%);
  background-attachment: fixed;
}
.cockpit-login {
  width: min(420px, 92vw);
  background: var(--cockpit-surface);
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--cockpit-shadow-md);
  border: 1px solid var(--cockpit-border);
}
.cockpit-login__brand { text-align: center; margin-bottom: 22px; }
.cockpit-login__brand img { width: 56px; height: 56px; object-fit: contain; }
.cockpit-login__brand h1 { margin: 14px 0 4px; font-size: 22px; font-weight: 900; letter-spacing: -.02em; color: var(--cockpit-text); }
.cockpit-login__brand p { margin: 0; color: var(--cockpit-muted); font-size: 13px; }
.cockpit-login__alert { background: #fdecec; border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #7a1a1a; margin-bottom: 14px; }
.cockpit-login__field { display: block; margin-bottom: 14px; }
.cockpit-login__field span { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--cockpit-muted); margin-bottom: 6px; }
.cockpit-login__field input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--cockpit-border); border-radius: 12px; font-family: inherit; font-size: 15px; background: #fff; color: var(--cockpit-text); }
.cockpit-login__field input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(228,158,0,.18); }
.cockpit-login__submit { width: 100%; padding: 13px 18px; border: none; border-radius: 12px; background: var(--yellow, #e49e00); color: #111; font-weight: 900; font-size: 15px; cursor: pointer; margin-top: 6px; }
.cockpit-login__submit:hover { filter: brightness(.96); }
.cockpit-login__footer { margin-top: 18px; text-align: center; font-size: 12px; color: var(--cockpit-muted); }
.cockpit-login__footer a { color: inherit; }

/* =========================================================
   Access-denied
   ========================================================= */
.cockpit-deny { padding: 80px 24px; text-align: center; }
.cockpit-deny__card { background: var(--cockpit-surface); border-radius: 22px; padding: 40px; max-width: 460px; margin: 0 auto; box-shadow: var(--cockpit-shadow-md); border: 1px solid var(--cockpit-border); }
.cockpit-deny__card h1 { margin: 0 0 12px; font-size: 24px; font-weight: 900; color: var(--cockpit-text); }
.cockpit-deny__card p { margin: 0 0 22px; color: var(--cockpit-muted); }

/* =========================================================
   Ported-page layout helpers (kill old margin-tops from
   pages that were built for the floating public header)
   ========================================================= */
.cockpit-content .account-hero,
.cockpit-content .dash-hero,
.cockpit-content .account-page,
.cockpit-content .dashboard-page {
  margin: 0;
  padding: 0;
}
.cockpit-content .account-tabs {
  margin-bottom: 18px;
}

/* =========================================================
   Mailbox (cockpit/mail*.php)
   ========================================================= */
.mailbox {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.mailbox__folders {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--cockpit-topbar-height) + 18px);
}
.mailbox__compose-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--yellow, #e49e00);
  color: #111;
  text-decoration: none;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 14px;
  justify-content: center;
}
.mailbox__compose-btn:hover { filter: brightness(.96); }
.mailbox__folder-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--cockpit-surface);
  border: 1px solid var(--cockpit-border);
  border-radius: 14px;
  padding: 6px;
}
.mailbox__folder {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--cockpit-text-soft);
  font-size: 13px;
  font-weight: 700;
}
.mailbox__folder:hover { background: var(--cockpit-hover); color: var(--cockpit-text); }
.mailbox__folder.is-active { background: var(--cockpit-yellow-soft); color: var(--cockpit-text); }
.mailbox__badge {
  background: var(--yellow, #e49e00);
  color: #111;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 900;
}

.mailbox__main {
  background: var(--cockpit-surface);
  border: 1px solid var(--cockpit-border);
  border-radius: 14px;
  overflow: hidden;
}
.mailbox__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--cockpit-border-soft);
}
.mailbox__title { margin: 0; font-size: 18px; font-weight: 800; color: var(--cockpit-text); }
.mailbox__sub { margin: 4px 0 0; font-size: 12px; color: var(--cockpit-muted); }
.mailbox__refresh {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  color: var(--cockpit-muted); text-decoration: none;
  background: var(--cockpit-bg);
}
.mailbox__refresh:hover { background: var(--cockpit-yellow-soft); color: var(--cockpit-text); }
.mailbox__alert {
  margin: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fdecec;
  color: #7a1a1a;
  font-size: 13px;
}
.mailbox__alert code { background: rgba(0,0,0,.05); padding: 2px 6px; border-radius: 4px; }
.mailbox__empty {
  padding: 60px 22px;
  text-align: center;
  color: var(--cockpit-muted);
}
.mailbox__list { list-style: none; margin: 0; padding: 0; }
.mailbox__item { border-bottom: 1px solid var(--cockpit-border-soft); }
.mailbox__item-link {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 22px;
  text-decoration: none;
  color: var(--cockpit-text);
  align-items: center;
}
.mailbox__item-link:hover { background: var(--cockpit-hover); }
.mailbox__item.is-unread .mailbox__item-link {
  background: #fffaef;
}
.mailbox__item.is-unread .mailbox__item-subject { font-weight: 900; }
.mailbox__item-sender {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mailbox__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--yellow, #e49e00);
  flex-shrink: 0;
}
.mailbox__item-subject {
  font-weight: 600;
  font-size: 14px;
  color: var(--cockpit-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mailbox__item-snippet {
  font-size: 12px;
  color: var(--cockpit-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mailbox__item-meta {
  display: flex; align-items: center; gap: 8px;
  color: var(--cockpit-muted);
  font-size: 12px;
  white-space: nowrap;
}
.mailbox__item-meta i { font-size: 14px; }

.mailbox__pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  font-size: 13px;
  color: var(--cockpit-muted);
}
.mailbox__pagination a {
  color: var(--yellow, #e49e00);
  font-weight: 800;
  text-decoration: none;
}

/* ---- Mailview (single message) ---- */
.mailview { display: flex; flex-direction: column; gap: 14px; }
.mailview__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.mailview__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cockpit-text-soft);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
}
.mailview__back:hover { color: var(--yellow, #e49e00); }
.mailview__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cockpit-surface);
  border: 1px solid var(--cockpit-border);
  color: var(--cockpit-text);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.btn-line:hover { background: var(--cockpit-yellow-soft); border-color: var(--cockpit-yellow-mid); }
.btn-line--danger { color: #b91c1c; border-color: #fecaca; }
.btn-line--danger:hover { background: #fee2e2; border-color: #fca5a5; }
.btn-yellow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--yellow, #e49e00); color: #111;
  border: none; padding: 11px 18px; border-radius: 10px;
  font-weight: 900; font-size: 14px;
  cursor: pointer; text-decoration: none;
  font-family: inherit;
}
.btn-yellow:hover { filter: brightness(.96); }

.mailview__card {
  background: var(--cockpit-surface);
  border: 1px solid var(--cockpit-border);
  border-radius: 14px;
  padding: 22px;
}
.mailview__subject {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--cockpit-text);
}
.mailview__meta {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 6px 14px;
  margin: 0 0 18px;
  font-size: 13px;
}
.mailview__meta dt { color: var(--cockpit-muted); font-weight: 700; }
.mailview__meta dd { margin: 0; color: var(--cockpit-text); word-break: break-word; }
.mailview__attachments {
  background: var(--cockpit-bg);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.mailview__attachments strong { display: block; font-size: 12px; color: var(--cockpit-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.mailview__attachments ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mailview__attachments a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cockpit-surface);
  border: 1px solid var(--cockpit-border);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--cockpit-text);
  font-size: 13px;
  font-weight: 700;
}
.mailview__attachments a:hover { background: var(--cockpit-yellow-soft); }
.mailview__attachments small { color: var(--cockpit-muted); font-weight: 600; }

.mailview__body {
  width: 100%;
  min-height: 380px;
  border: 1px solid var(--cockpit-border);
  border-radius: 10px;
  background: #fff;
}
.mailview__text {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--cockpit-text);
  margin: 0;
  padding: 12px 14px;
  background: var(--cockpit-bg);
  border-radius: 10px;
}

/* ---- Compose ---- */
.mailcompose {
  background: var(--cockpit-surface);
  border: 1px solid var(--cockpit-border);
  border-radius: 14px;
  padding: 22px;
  max-width: 820px;
}
.mailcompose__head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.mailcompose__head h1 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.mailcompose__form { display: flex; flex-direction: column; gap: 14px; }
.mailcompose__row { display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: center; }
.mailcompose__row label { font-weight: 700; color: var(--cockpit-text-soft); font-size: 13px; }
.mailcompose__row input[type="text"],
.mailcompose__row input[type="email"],
.mailcompose__row textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid var(--cockpit-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
}
.mailcompose__row input[type="file"] { padding: 8px 0; }
.mailcompose__row textarea { resize: vertical; min-height: 220px; line-height: 1.5; }
.mailcompose__row input:focus,
.mailcompose__row textarea:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(228,158,0,.15);
}
.mailcompose__from {
  padding: 11px 14px;
  background: var(--cockpit-bg);
  border-radius: 10px;
  font-weight: 700;
  color: var(--cockpit-text);
}
.mailcompose__advanced {
  background: var(--cockpit-bg);
  border-radius: 10px;
  padding: 6px 12px;
}
.mailcompose__advanced summary { padding: 8px 0; font-weight: 700; cursor: pointer; color: var(--cockpit-text-soft); }
.mailcompose__advanced[open] summary { color: var(--cockpit-text); }
.mailcompose__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--cockpit-border-soft);
}

/* =========================================================
   Mobile App-Nav (bottom bar — staff-first UX)
   ========================================================= */
.app-nav { display: none; }

@media (max-width: 1100px) {
  .cockpit-grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cockpit-grid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cockpit-topbar__link-text,
  .cockpit-topbar__user-meta { display: none; }
  .cockpit-topbar__user { padding: 4px; }
}

@media (max-width: 860px) {
  /* ---- Mailbox on mobile: stack folders above list ---- */
  .mailbox { grid-template-columns: 1fr; }
  .mailbox__folders { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .mailbox__folder-list { flex-direction: row; padding: 4px; }
  .mailbox__folder { white-space: nowrap; }
  .mailbox__item-link { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
  .mailbox__item-sender { font-size: 13px; }
  .mailbox__item-snippet { white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .mailcompose__row { grid-template-columns: 1fr; gap: 4px; align-items: stretch; }
  .mailcompose__row label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--cockpit-muted); }

  .cockpit-shell { grid-template-columns: 1fr; }
  .cockpit-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 290px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 200;
    box-shadow: 0 0 40px rgba(0,0,0,.18);
    will-change: transform;
  }
  body.cockpit-menu-open .cockpit-sidebar { transform: translateX(0); }
  body.cockpit-menu-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 150;
    cursor: pointer;
  }
  .cockpit-topbar__menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .cockpit-topbar { padding: 0 16px; }
  .cockpit-content {
    padding: 18px 14px calc(90px + env(safe-area-inset-bottom, 0px));
  }
  .cockpit-footer { display: none; }
  .cockpit-grid--4,
  .cockpit-grid--3,
  .cockpit-grid--2 { grid-template-columns: 1fr; }

  /* ----- Bottom tab bar ----- */
  .app-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--cockpit-surface);
    border-top: 1px solid var(--cockpit-border);
    z-index: 90;
    padding: 4px 4px env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -2px 18px rgba(0,0,0,.06);
    gap: 2px;
  }
  .app-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--cockpit-muted);
    font-size: 11px;
    font-weight: 800;
    padding: 8px 4px 6px;
    border-radius: 12px;
    min-height: 58px;
    transition: color .15s, background .15s;
    -webkit-tap-highlight-color: rgba(228,158,0,.18);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    touch-action: manipulation;
    position: relative;
  }
  .app-nav__item:active { background: var(--cockpit-yellow-soft); }
  .app-nav__item.is-active { color: var(--yellow, #e49e00); }
  .app-nav__item.is-active .app-nav__icon { color: var(--yellow, #e49e00); }
  .app-nav__item.is-active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 32px;
    height: 3px;
    background: var(--yellow, #e49e00);
    border-radius: 0 0 6px 6px;
  }
  .app-nav__icon { font-size: 22px; line-height: 1; color: var(--cockpit-text); pointer-events: none; }
  .app-nav__label { line-height: 1.1; pointer-events: none; }
  .app-nav__avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; pointer-events: none; }
  body.cockpit-menu-open .app-nav__item--more .app-nav__avatar { border-color: var(--yellow, #e49e00); }
  body.cockpit-menu-open .app-nav__item--more { color: var(--yellow, #e49e00); }
}
