/* === Synaria CRM — Responsive CSS === */

/* Hide mobile menus on desktop by default */
.topmenu-mobil {
  display: none !important;
}

.menu-mobil {
  display: none !important;
}

.menu-mobil-panel {
  display: none !important;
}

/* ============================================
   MOBILE STYLES (max-width: 768px)
   ============================================ */

@media (max-width: 1100px) {
  /* Hide desktop menus on mobile/tablet */
  .topbar,
  .topmenu-pc,
  header.topbar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  html body .wrap .side,
  html body .wrap .menu-pc,
  html body .wrap aside.side,
  html body .wrap aside.menu-pc,
  html body .wrap aside.side.menu-pc,
  html body .wrap aside.side.menu-pc *,
  html body #sidebar-desktop-grant,
  html body #sidebar-desktop-calendar,
  html body #sidebar-desktop-gmail,
  html body #sidebar-desktop-admin,
  html body div.wrap > aside.side,
  html body div.wrap > aside.menu-pc,
  html body aside.side.menu-pc[id],
  html body aside.menu-pc[id] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Show mobile top menu */
  .topmenu-mobil {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 56px;
  }

  .topmenu-mobil .brand {
    flex: 0 0 auto;
    margin-right: 12px;
  }

  .topmenu-mobil .brand img {
    height: 32px;
    width: auto;
  }

  .topmenu-mobil .modules-mobil {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .topmenu-mobil .modules-mobil::-webkit-scrollbar {
    display: none;
  }

  .topmenu-mobil .modules-mobil .mod {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0;
    transition: background-color 0.2s;
  }

  .topmenu-mobil .modules-mobil .mod img {
    width: 28px;
    height: 28px;
    object-fit: contain;
  }

  .topmenu-mobil .modules-mobil .mod.active {
    background-color: #f3f4f6;
  }

  .topmenu-mobil-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: 8px;
  }

  .topmenu-mobil .helpdesk-link,
  .topmenu-mobil .logout-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s;
  }

  .topmenu-mobil .helpdesk-link img {
    width: 20px;
    height: 20px;
  }

  .topmenu-mobil .helpdesk-link:hover,
  .topmenu-mobil .logout-link:hover {
    background-color: #f3f4f6;
  }

  .topmenu-mobil .logout-link svg {
    width: 18px;
    height: 18px;
    stroke: #374151;
  }

  /* Mobile Left Panel (wider panel for opening menu) */
  .menu-mobil-panel {
    display: flex !important;
    position: fixed !important;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 60px;
    min-width: 16px;
    max-width: 16px;
    padding: 0;
    margin: 0;
    border: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    background: #0b1220;
    color: #ffffff;
    cursor: pointer;
    z-index: 2100 !important;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease, background-color 0.2s;
    box-sizing: border-box;
    pointer-events: auto !important;
  }

  .menu-mobil-panel svg {
    width: 10px;
    height: 10px;
    display: block;
  }

  .menu-mobil-panel:hover {
    background: #1e293b;
  }

  .menu-mobil-panel:active {
    background: #334155;
  }

  /* Mobile Sidebar Menu (Drawer) */
  .menu-mobil {
    display: block !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--neo-card, #ffffff);
    border-right: 1px solid var(--neo-border, rgba(255, 255, 255, 0.1));
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 2000 !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
    border-radius: 0;
    pointer-events: auto !important;
  }

  .menu-mobil-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 14px 0;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--neo-border, rgba(0, 0, 0, 0.1));
  }

  .menu-mobil-close {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--neo-muted, #6b7280);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
  }

  .menu-mobil-close:hover {
    background-color: var(--neo-bg-hover, #f3f4f6);
  }

  .menu-mobil-close:active {
    background-color: var(--neo-bg-active, #e5e7eb);
  }

  .menu-mobil .head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    color: var(--neo-muted, #6b7280);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
  }

  .menu-mobil nav {
    padding: 0;
  }

  .menu-mobil .menu-group {
    margin-bottom: 16px;
  }

  .menu-mobil .menu-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: var(--neo-muted, #6b7280);
  }

  .menu-mobil .menu-group a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    color: var(--neo-fg, #1f2937);
    text-decoration: none;
    transition: background-color 0.2s;
    margin-bottom: 4px;
  }

  .menu-mobil .menu-group a:hover {
    background: var(--neo-bg-hover, #f3f4f6);
  }

  .menu-mobil .menu-group a.active {
    background: var(--neo-primary, #3b82f6);
    color: #ffffff;
  }

  .menu-mobil .menu-group a span {
    font-size: 14px;
  }


  /* Show mobile menu when open */
  body.menu-mobil-open .menu-mobil {
    transform: translateX(0) !important;
    pointer-events: auto !important;
  }

  /* Move panel when menu is open */
  body.menu-mobil-open .menu-mobil-panel {
    left: 280px !important;
    pointer-events: auto !important;
  }

  /* Backdrop when menu is open */
  body.menu-mobil-open #menu-mobil-backdrop {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Prevent body scroll when menu is open */
  body.menu-mobil-open {
    overflow: hidden;
  }
}

/* ============================================
   TABLES RESPONSIVE
   ============================================ */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

@media (max-width: 768px) {
  .table th,
  .table td {
    padding: 6px 8px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* ============================================
   PREVENT HORIZONTAL OVERFLOW ON MOBILE
   ============================================ */

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
  }

  .wrap,
  .container,
  .content,
  .app-content,
  .page,
  .main,
  .card {
    max-width: 100vw;
    width: 100% !important;
    box-sizing: border-box;
  }

         /* .wrap grid zůstává 1fr 3fr z neo-ui.css */

  .content,
  .app-content,
  .page,
  .main {
    padding-left: 12px;
    padding-right: 12px;
  }

  img,
  svg {
    max-width: 100%;
    height: auto;
  }

  .table-wrapper {
    margin-right: -12px;
    padding-right: 12px;
  }

  .table {
    width: max-content;
    max-width: 100%;
  }

  .table th,
  .table td {
    white-space: nowrap;
  }
}
