.adm-mtop,
.adm-drawer,
.adm-scrim,
.swf-files-toggle,
.swf-files-scrim {
  display: none;
}

@media (max-width: 860px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  .minya-navbar {
    display: none !important;
  }

  .adm-mtop {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    z-index: 1200;
    padding: 0 14px;
    background: linear-gradient(180deg, rgba(45, 28, 20, 0.98), rgba(26, 15, 7, 0.98));
    border-bottom: 2px solid var(--mny-cuivre, #c87743);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  }

  .adm-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 0 9px;
    background: rgba(200, 119, 67, 0.16);
    border: 1px solid rgba(200, 119, 67, 0.42);
    border-radius: 11px;
    flex-shrink: 0;
  }

  .adm-burger span {
    display: block;
    height: 2.5px;
    border-radius: 2px;
    background: var(--mny-beige-clair, #f4dac1);
    transition: transform 0.2s, opacity 0.2s;
  }

  body.adm-drawer-open .adm-burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  body.adm-drawer-open .adm-burger span:nth-child(2) { opacity: 0; }
  body.adm-drawer-open .adm-burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  .adm-mtop-title {
    flex: 1;
    min-width: 0;
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 1.15rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  }

  .adm-mtop-site {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    background: rgba(200, 119, 67, 0.16);
    border: 1px solid rgba(200, 119, 67, 0.42);
    border-radius: 11px;
    flex-shrink: 0;
  }

  .adm-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(26, 20, 38, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s;
  }

  body.adm-drawer-open .adm-scrim {
    opacity: 1;
    visibility: visible;
  }

  .adm-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 340px);
    z-index: 1400;
    background: var(--alt-white, #241710);
    border-right: 2px solid var(--mny-cuivre, #c87743);
    box-shadow: 6px 0 30px rgba(90, 61, 37, 0.35);
    transform: translateX(-104%);
    transition: transform 0.28s cubic-bezier(0.22, 1.2, 0.36, 1);
  }

  body.adm-drawer-open .adm-drawer {
    transform: translateX(0);
  }

  .adm-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(45, 28, 20, 0.98), rgba(26, 15, 7, 0.98));
    color: var(--mny-beige-clair, #f4dac1);
    border-bottom: 2px solid var(--mny-cuivre, #c87743);
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  .adm-drawer-close {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(200, 119, 67, 0.16);
    border: 1px solid rgba(200, 119, 67, 0.42);
    border-radius: 10px;
    color: var(--mny-beige-clair, #f4dac1);
  }

  .adm-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .adm-drawer-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--alt-ink-faint, #b49a82);
    padding: 14px 10px 6px;
  }

  .adm-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 13px 14px;
    margin-bottom: 4px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--alt-ink, #e9ecef);
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 1rem;
    letter-spacing: 0.2px;
  }

  .adm-drawer-item i {
    font-size: 1.1rem;
    color: var(--alt-green, #c87743);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
  }

  .adm-drawer-item:active {
    background: var(--alt-cream-deep, rgba(200,119,67,.14));
  }

  .adm-drawer-item.active {
    background: var(--alt-yellow, #a94c60);
    border-color: #8e3d50;
    color: var(--alt-brown-deep, #1a0f07);
  }

  .adm-drawer-item.active i {
    color: var(--alt-brown-deep, #1a0f07);
  }

  .minya-main-content {
    height: calc(100vh - 54px) !important;
    margin-top: 54px !important;
  }

  .content-section {
    padding: 12px !important;
  }

  .content-section .card-body,
  .content-section .card-header {
    padding: 14px !important;
  }

  .row {
    margin-left: 0;
    margin-right: 0;
  }

  input,
  select,
  textarea,
  .form-control,
  .form-select {
    font-size: 16px !important;
  }

  .modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
  }

  .content-section table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  pre,
  code,
  .swf-preview,
  #swfPreview,
  .lang-preview,
  .monaco-editor {
    max-width: 100%;
    overflow-x: auto;
  }

  .item-tabs-bar,
  .monster-tabs,
  .nav.nav-tabs,
  .donjon-sub-tabs,
  .kanban-subtabs,
  .kanban-view-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .item-tabs-bar::-webkit-scrollbar,
  .monster-tabs::-webkit-scrollbar,
  .nav.nav-tabs::-webkit-scrollbar,
  .donjon-sub-tabs::-webkit-scrollbar,
  .kanban-subtabs::-webkit-scrollbar,
  .kanban-view-tabs::-webkit-scrollbar {
    display: none;
  }

  .item-tab,
  .monster-tab,
  .nav-tabs .nav-link,
  .kanban-subtab,
  .kanban-view-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .swf-layout {
    grid-template-columns: 1fr !important;
    position: relative;
  }

  .swf-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    width: min(84vw, 300px);
    transform: translateX(-104%);
    transition: transform 0.26s cubic-bezier(0.22, 1.2, 0.36, 1);
    box-shadow: 6px 0 26px rgba(26, 20, 38, 0.35);
  }

  .swf-layout.swf-files-open .swf-sidebar {
    transform: translateX(0);
  }

  .swf-files-scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 35;
    background: rgba(26, 20, 38, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s;
  }

  .swf-layout.swf-files-open .swf-files-scrim {
    opacity: 1;
    visibility: visible;
  }

  .swf-files-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 100%;
    padding: 0 12px;
    border: none;
    border-right: 2px solid var(--swf-border);
    background: var(--alt-yellow);
    color: var(--alt-brown-deep);
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .swf-toolbar {
    height: 46px !important;
  }

  .swf-tabs {
    min-width: 0;
  }

  .kanban-wrapper {
    flex-direction: column;
    height: 100%;
  }

  .kanban-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    max-height: 168px;
    border-right: none;
    border-bottom: 2px solid rgba(221, 205, 162, 0.6);
  }

  .kanban-sidebar::after {
    display: none;
  }

  .kanban-main {
    min-width: 0;
    flex: 1;
  }

  .kanban-topbar,
  .kanban-subnav,
  .kanban-filters {
    flex-wrap: wrap;
    gap: 8px;
  }

  .btn-lg {
    padding: 12px 20px;
    font-size: 1rem;
  }

  .d-flex.gap-2,
  .d-flex.gap-3 {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .content-section {
    padding: 10px !important;
  }

  .adm-mtop-title {
    font-size: 1.05rem;
  }

  h5,
  .card-title {
    font-size: 1.05rem;
  }
}
