/* ==========================================================================
   CMS Panel Styles — Dotknij Nieba | FLYCAR
   Mobile-First & Fortress UI Architecture
   ========================================================================== */

:root {
  --bg: #070a12;
  --bg2: #0d1320;
  --card: #111a2b;
  --card2: #162238;
  --line: rgba(238, 240, 244, 0.1);
  --line-light: rgba(238, 240, 244, 0.16);
  --ink: #eef0f4;
  --muted: #8a96aa;
  --amber: #e8b36a;
  --amber2: #f4d3a1;
  --green: #4ade80;
  --red: #f87171;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: 'Cinzel', serif;
  --sidebar-w: 260px;
  --panel-w: 540px;
}

*, *::before, *::after {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  min-height: 100svh;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ==========================================================================
   LOGIN SCREEN (Pancerne, wyśrodkowane i 100% responsywne)
   ========================================================================== */
#login-view {
  min-height: 100svh;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  background: radial-gradient(circle at 50% 20%, rgba(232, 179, 106, 0.08) 0%, transparent 60%), var(--bg);
  overflow-y: auto;
  box-sizing: border-box !important;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(24px, 6vw, 36px) clamp(18px, 5vw, 32px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  margin: auto;
  box-sizing: border-box !important;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 22px;
}

.brand-title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 4vw, 1.6rem);
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--ink);
}

.brand-title em {
  color: var(--amber);
  font-style: normal;
}

.brand-badge {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber2);
  background: rgba(232, 179, 106, 0.12);
  border: 1px solid rgba(232, 179, 106, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.login-card h2 {
  font-size: clamp(1.2rem, 3.5vw, 1.4rem);
  font-weight: 600;
  margin-bottom: 6px;
  text-align: center;
}

.login-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 22px;
  text-align: center;
}

.login-foot {
  margin-top: 24px;
  text-align: center;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.foot-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  transition: color 0.2s;
  display: inline-block;
  padding: 6px 0;
}

.foot-link:hover {
  color: var(--amber);
}

/* ==========================================================================
   APP SHELL (3 ZONES: SIDEBAR, MAIN, RIGHTPANEL)
   ========================================================================== */
#app-shell {
  display: flex;
  height: 100vh;
  min-height: 100svh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  position: relative;
}

/* Mobile Topbar — domyślnie ukryty na desktopie */
.mobile-topbar {
  display: none;
}
.sidebar-head-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.btn-sidebar-close {
  display: none;
}
.sidebar-backdrop {
  display: none;
}

/* 1. SIDEBAR */
#app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-brand {
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
  flex: 1;
}

.sidebar-brand a {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.sidebar-brand em {
  color: var(--amber);
  font-style: normal;
}

.sb-sub {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  font-weight: 500;
}

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber) 0%, #b8860b 100%);
  color: #1a1209;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
}

.user-role {
  font-size: 0.74rem;
  color: var(--muted);
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  min-height: 44px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.nav-item.active {
  background: rgba(232, 179, 106, 0.12);
  color: var(--amber2);
  font-weight: 600;
}

.nav-item.cta-add {
  margin-top: 10px;
  background: rgba(232, 179, 106, 0.16);
  border: 1px dashed rgba(232, 179, 106, 0.4);
  color: var(--amber2);
}

.nav-item.cta-add:hover {
  background: var(--amber);
  color: #1a1209;
  border-color: var(--amber);
}

.pill-counter {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--muted);
}

.nav-item.active .pill-counter {
  background: var(--amber);
  color: #1a1209;
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sb-foot-btn {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.86rem;
  color: var(--muted);
  transition: all 0.2s;
  text-decoration: none;
  min-height: 40px;
}

.sb-foot-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.sb-foot-btn.logout:hover {
  color: var(--red);
}

/* 2. MAIN WORKSPACE */
#app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 36px 60px;
  background: var(--bg);
  width: 100%;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
}

.main-header h1 {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 600;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 360px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  outline: none;
  min-height: 44px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group select {
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
  min-height: 44px;
}

/* Data Table (Desktop View) */
.table-container {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 18px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(238, 240, 244, 0.06);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.thumb-cell {
  width: 60px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  background: #05080e;
  border: 1px solid var(--line);
  display: block;
}

.thumb-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.title-cell {
  display: flex;
  flex-direction: column;
}

.story-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.story-loc {
  font-size: 0.8rem;
  color: var(--muted);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-tag.cat-lot-widokowy { color: #64b5f6; background: rgba(100, 181, 246, 0.12); border: 1px solid rgba(100, 181, 246, 0.28); }
.badge-tag.cat-historia-pasazera { color: #e8b36a; background: rgba(232, 179, 106, 0.12); border: 1px solid rgba(232, 179, 106, 0.28); }
.badge-tag.cat-akcja-spoleczna { color: #81c784; background: rgba(129, 199, 132, 0.12); border: 1px solid rgba(129, 199, 132, 0.28); }
.badge-tag.cat-wyprawa { color: #ba68c8; background: rgba(186, 104, 200, 0.12); border: 1px solid rgba(186, 104, 200, 0.28); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

.status-pill.published {
  background: rgba(74, 222, 128, 0.12);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.status-pill.published::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.status-pill.draft {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid var(--line);
}

.pin-featured {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--amber);
  font-size: 0.74rem;
  font-weight: 600;
  margin-left: 6px;
}

/* Actions in Table */
.actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-table {
  all: unset;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: all 0.2s;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-table:hover {
  background: rgba(232, 179, 106, 0.15);
  border-color: var(--amber);
  color: var(--amber2);
}

.btn-table.danger:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: var(--red);
  color: var(--red);
}

/* State Boxes */
.state-box {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}

.state-box svg {
  margin-bottom: 12px;
  color: var(--muted);
}

.state-box h3 {
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 6px;
}

.state-box p {
  font-size: 0.9rem;
  margin-bottom: 18px;
}

/* 3. #app-rightpanel (NO-MODAL DOCKED / SLIDE SHEET) */
#app-rightpanel {
  width: var(--panel-w);
  flex-shrink: 0;
  background: var(--card);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  z-index: 60;
  overflow-y: auto;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-eyebrow {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 600;
  margin-bottom: 2px;
}

.panel-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.btn-close {
  all: unset;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: all 0.2s;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.panel-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Form Controls — 16px font-size to prevent iOS Safari auto-zoom! */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.field label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #dbe1ee;
}

.field input[type="text"],
.field input[type="url"],
.field input[type="date"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px !important; /* 16px prevents iOS zoom-in glitch */
  outline: none;
  transition: border-color 0.2s;
  min-height: 48px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--amber);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-checkbox {
  margin-bottom: 18px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--ink);
  min-height: 36px;
}

.checkbox-label input {
  accent-color: var(--amber);
  width: 18px;
  height: 18px;
}

/* Upload Zone */
.upload-zone {
  position: relative;
  background: var(--bg2);
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.upload-zone:hover {
  border-color: var(--amber);
}

.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.upload-prompt svg {
  color: var(--amber);
}

.upload-prompt span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}

.upload-prompt small {
  font-size: 0.78rem;
}

.upload-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-img {
  all: unset;
  position: absolute;
  top: 8px;
  right: 8px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn-remove-img:hover {
  background: var(--red);
}

/* Gallery Grid in Form */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.gallery-item-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.gallery-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-upload-zone {
  position: relative;
}

/* Panel Actions */
.panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* Buttons */
.btn {
  all: unset;
  box-sizing: border-box !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  min-height: 48px;
}

.btn-primary {
  background: var(--amber);
  color: #1a1209;
}

.btn-primary:hover {
  background: #f4d3a1;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-block {
  width: 100% !important;
  box-sizing: border-box !important;
}

.btn-icon {
  padding: 10px 14px;
}

/* Alerts */
.alert-box {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.alert-box.error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.alert-box.success {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #86efac;
}

/* Spinner */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(232, 179, 106, 0.2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

.spinner-small {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #1a1209;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Card Narrow (Password) */
.card-narrow {
  max-width: 500px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE RULES (<= 900px & <= 768px)
   ========================================================================== */

@media (max-width: 900px) {
  /* 1. App Shell switches to vertical */
  #app-shell {
    flex-direction: column;
    height: auto;
    min-height: 100svh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* 2. Mobile Topbar appears */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 16px;
    background: var(--bg2);
    border-bottom: 1px solid var(--line);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
  }
  .mobile-brand em {
    color: var(--amber);
    font-style: normal;
  }
  .mobile-brand-pill {
    font-family: var(--sans);
    font-size: 0.65rem;
    text-transform: uppercase;
    background: rgba(232, 179, 106, 0.12);
    color: var(--amber2);
    border: 1px solid rgba(232, 179, 106, 0.3);
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 600;
  }

  .btn-sidebar-toggle, .btn-mobile-add {
    all: unset;
    cursor: pointer;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    color: var(--ink);
    transition: background 0.2s;
  }
  .btn-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  .btn-mobile-add {
    background: var(--amber);
    color: #1a1209;
    border-color: var(--amber);
  }

  /* 3. Off-Canvas Sidebar Drawer */
  #app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(300px, 85vw);
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: none;
    background: #0d1320;
  }
  #app-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  }

  .btn-sidebar-close {
    all: unset;
    cursor: pointer;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-right: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 12, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 450;
    display: block;
  }
  .sidebar-backdrop.hidden {
    display: none !important;
  }

  /* 4. Main Workspace adjustments */
  #app-main {
    padding: 76px 16px 40px; /* 60px topbar + 16px spacing */
    width: 100%;
    max-width: 100vw;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }
  .main-header .header-actions {
    display: none; /* replaced by topbar btn-mobile-add */
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .search-box {
    max-width: 100%;
    width: 100%;
  }
  .filter-group {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .filter-group select {
    flex: 1;
    min-width: 0;
  }

  /* 5. Rightpanel (Edit Sheet) on Mobile */
  #app-rightpanel {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100svh;
    z-index: 600;
    border-left: none;
    border-radius: 0;
  }

  .panel-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--card);
    padding: 16px 18px;
  }

  .panel-body {
    padding: 18px 16px 90px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .panel-actions {
    position: sticky;
    bottom: 0;
    background: var(--card);
    padding: 14px 16px;
    margin: 20px -16px -16px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
    z-index: 10;
  }
  .panel-actions .btn {
    flex: 1;
  }
}

/* Mobile Story Cards (<= 768px) */
@media (max-width: 768px) {
  .table-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .data-table {
    display: block !important;
    width: 100% !important;
  }

  .data-table thead {
    display: none !important;
  }

  .data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
  }

  .data-table tr {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    background: var(--card) !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    padding: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .data-table td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
  }

  .data-table td.cell-thumb {
    grid-column: 1 / -1 !important;
  }

  .thumb-cell {
    width: 100% !important;
    height: 180px !important;
    border-radius: 10px !important;
    margin-bottom: 2px !important;
  }

  .data-table td.cell-title {
    grid-column: 1 / -1 !important;
  }

  .story-title {
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
    margin-bottom: 4px !important;
  }

  .story-loc {
    font-size: 0.84rem !important;
    color: var(--muted) !important;
  }

  .data-table td.cell-cat {
    grid-column: 1 / 2 !important;
    display: flex !important;
    align-items: center !important;
  }

  .data-table td.cell-date {
    grid-column: 2 / 3 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    font-size: 0.82rem !important;
    color: var(--muted) !important;
  }

  .data-table td.cell-status {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: center !important;
  }

  .data-table td.cell-actions {
    grid-column: 1 / -1 !important;
  }

  .actions-cell {
    display: grid !important;
    grid-template-columns: 1fr 1fr auto !important;
    gap: 8px !important;
    margin-top: 8px !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--line) !important;
    width: 100% !important;
  }

  .btn-table {
    padding: 10px 12px !important;
    font-size: 0.88rem !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  .btn-table.danger {
    min-width: 44px !important;
  }
}
