/* MBus WMS v44 – ultra kompakten File Explorer pogled
   Cilj: desktop vrstice naj bodo podobne Windows File Explorerju.
   Mobilni terminal se ne spreminja. */

@media (min-width: 901px) {
  body.mbus-desktop-pro {
    --mbus-desktop-sidebar: 244px !important;
    --mbus-file-row: 27px;
    --mbus-file-head: 25px;
    --mbus-file-border: #d8e0ea;
    --mbus-file-hover: #eaf2ff;
    --mbus-file-select: #dbeafe;
    --mbus-file-ink: #111827;
    --mbus-file-muted: #637189;
    background: #eef3f8 !important;
  }

  body.mbus-desktop-pro main[class*="lg:pl-64"] {
    padding-left: var(--mbus-desktop-sidebar) !important;
    padding-top: 58px !important;
    padding-bottom: 12px !important;
  }

  body.mbus-desktop-pro main > div {
    max-width: none !important;
    padding: 10px 12px 18px !important;
  }

  /* Zgornja vrstica manjša, bolj kot toolbar. */
  body.mbus-desktop-pro .mbus-desktop-probar {
    height: 56px !important;
    left: var(--mbus-desktop-sidebar) !important;
    padding: 6px 16px !important;
    gap: 8px !important;
    grid-template-columns: minmax(170px, 260px) minmax(0, 1fr) max-content !important;
    box-shadow: 0 8px 18px rgba(15,23,42,.06) !important;
  }
  body.mbus-desktop-pro .mbus-desktop-probar-kicker { font-size: 9px !important; }
  body.mbus-desktop-pro .mbus-desktop-probar-title { font-size: 18px !important; margin-top: 1px !important; }
  body.mbus-desktop-pro .mbus-desktop-probar-subtitle { font-size: 11px !important; margin-top: 0 !important; }
  body.mbus-desktop-pro .mbus-desktop-search-wrap {
    height: 34px !important;
    border-radius: 9px !important;
    padding: 0 9px !important;
  }
  body.mbus-desktop-pro .mbus-desktop-search { font-size: 12px !important; }
  body.mbus-desktop-pro .mbus-desktop-refresh,
  body.mbus-desktop-pro .mbus-desktop-role-badge,
  body.mbus-desktop-pro .mbus-desktop-clock,
  body.mbus-desktop-pro .mbus-desktop-quicklinks a {
    min-height: 30px !important;
    height: 30px !important;
    padding: 0 10px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
  }

  /* Levi meni kot ozka mapa v Explorerju. */
  body.mbus-desktop-pro aside[class*="fixed"][class*="left-0"] {
    width: var(--mbus-desktop-sidebar) !important;
    box-shadow: 8px 0 18px rgba(15,23,42,.04) !important;
  }
  body.mbus-desktop-pro aside nav a {
    min-height: 30px !important;
    height: 30px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-radius: 6px !important;
    font-size: 12px !important;
  }
  body.mbus-desktop-pro aside nav svg { width: 14px !important; height: 14px !important; }
  body.mbus-desktop-pro aside [class*="p-4"],
  body.mbus-desktop-pro aside [class*="px-4"] { padding-left: 12px !important; padding-right: 12px !important; }

  /* Glavni naslov/toolbar brez velikih praznih površin. */
  body.mbus-desktop-pro main h1,
  body.mbus-desktop-pro main [class*="text-4xl"],
  body.mbus-desktop-pro main [class*="text-3xl"] {
    font-size: 21px !important;
    line-height: 1.08 !important;
    letter-spacing: -0.025em !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
  }
  body.mbus-desktop-pro main h2,
  body.mbus-desktop-pro main [class*="text-2xl"] {
    font-size: 17px !important;
    line-height: 1.1 !important;
  }
  body.mbus-desktop-pro main .mbus-explorer-hint { display: none !important; }
  body.mbus-desktop-pro main p { margin-top: 2px !important; }

  body.mbus-desktop-pro main .mb-6 { margin-bottom: 8px !important; }
  body.mbus-desktop-pro main .mb-4 { margin-bottom: 7px !important; }
  body.mbus-desktop-pro main .mt-6 { margin-top: 8px !important; }
  body.mbus-desktop-pro main .mt-4 { margin-top: 7px !important; }
  body.mbus-desktop-pro main .gap-6 { gap: 8px !important; }
  body.mbus-desktop-pro main .gap-4 { gap: 7px !important; }
  body.mbus-desktop-pro main .gap-3 { gap: 6px !important; }
  body.mbus-desktop-pro main .grid { gap: 8px !important; }

  /* Kartice naj bodo samo tanek okvir, ne velike dashboard plošče. */
  body.mbus-desktop-pro main [data-slot="card"],
  body.mbus-desktop-pro main .bg-card,
  body.mbus-desktop-pro main [class*="bg-card"],
  body.mbus-desktop-pro main .rounded-xl.border,
  body.mbus-desktop-pro main .rounded-lg.border,
  body.mbus-desktop-pro main .rounded-md.border {
    border-radius: 7px !important;
    box-shadow: none !important;
    border-color: var(--mbus-file-border) !important;
    background: rgba(255,255,255,.94) !important;
  }
  body.mbus-desktop-pro main [data-slot="card-content"],
  body.mbus-desktop-pro main .p-6,
  body.mbus-desktop-pro main .p-5,
  body.mbus-desktop-pro main .p-4,
  body.mbus-desktop-pro main .py-6,
  body.mbus-desktop-pro main .py-5,
  body.mbus-desktop-pro main .py-4 {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
  }
  body.mbus-desktop-pro main .px-6,
  body.mbus-desktop-pro main .px-5,
  body.mbus-desktop-pro main .px-4,
  body.mbus-desktop-pro main .p-6,
  body.mbus-desktop-pro main .p-5,
  body.mbus-desktop-pro main .p-4 {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }

  /* Gumbi/filtri kot Explorer command bar. */
  body.mbus-desktop-pro main button,
  body.mbus-desktop-pro main a[role="button"],
  body.mbus-desktop-pro main a.inline-flex,
  body.mbus-desktop-pro main [role="button"] {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 9px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-shadow: none !important;
  }
  body.mbus-desktop-pro main button svg,
  body.mbus-desktop-pro main a[role="button"] svg,
  body.mbus-desktop-pro main a.inline-flex svg {
    width: 13px !important;
    height: 13px !important;
  }
  body.mbus-desktop-pro main input:not([type="checkbox"]):not([type="radio"]),
  body.mbus-desktop-pro main textarea,
  body.mbus-desktop-pro main [role="combobox"] {
    min-height: 30px !important;
    height: 30px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  body.mbus-desktop-pro main label { font-size: 12px !important; }
  body.mbus-desktop-pro main [role="switch"],
  body.mbus-desktop-pro main button[role="switch"] {
    width: 30px !important;
    min-width: 30px !important;
    height: 17px !important;
    min-height: 17px !important;
    border-radius: 999px !important;
    padding: 0 !important;
  }
  body.mbus-desktop-pro main [role="checkbox"],
  body.mbus-desktop-pro main button[role="checkbox"] {
    width: 16px !important;
    min-width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    border-radius: 3px !important;
    padding: 0 !important;
  }

  /* Pravi file-list izgled za vse tabele. */
  body.mbus-desktop-pro main .mbus-desktop-table-wrap,
  body.mbus-desktop-pro main .mbus-global-explorer-table-wrap,
  body.mbus-desktop-pro main [class*="overflow-x-auto"]:has(> table) {
    border-radius: 6px !important;
    border: 1px solid var(--mbus-file-border) !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: auto !important;
  }
  body.mbus-desktop-pro main table,
  body.mbus-desktop-pro main table.mbus-desktop-table,
  body.mbus-desktop-pro main table.mbus-global-explorer-table {
    min-width: 0 !important;
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: auto !important;
    font-size: 11.5px !important;
  }
  body.mbus-desktop-pro main table thead th,
  body.mbus-desktop-pro main table.mbus-desktop-table thead th,
  body.mbus-desktop-pro main table.mbus-global-explorer-table thead th {
    top: 56px !important;
    height: var(--mbus-file-head) !important;
    min-height: var(--mbus-file-head) !important;
    padding: 3px 7px !important;
    border-bottom: 1px solid #c8d2df !important;
    background: #f3f6fa !important;
    color: #4b5563 !important;
    font-size: 10px !important;
    line-height: 1 !important;
    letter-spacing: .035em !important;
    white-space: nowrap !important;
    box-shadow: none !important;
  }
  body.mbus-desktop-pro main table tbody tr {
    height: var(--mbus-file-row) !important;
    transition: none !important;
  }
  body.mbus-desktop-pro main table tbody td,
  body.mbus-desktop-pro main table.mbus-desktop-table tbody td,
  body.mbus-desktop-pro main table.mbus-global-explorer-table tbody td {
    height: var(--mbus-file-row) !important;
    min-height: var(--mbus-file-row) !important;
    max-height: var(--mbus-file-row) !important;
    padding: 2px 7px !important;
    border-bottom: 1px solid #e8edf4 !important;
    font-size: 11.5px !important;
    line-height: 1.05 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: var(--mbus-file-ink) !important;
  }
  body.mbus-desktop-pro main table tbody tr:hover td { background: var(--mbus-file-hover) !important; }
  body.mbus-desktop-pro main table tbody tr:focus-within td { background: var(--mbus-file-select) !important; }

  /* Druga vrstica v celici postane majhen siv dodatek v isti vrstici. */
  body.mbus-desktop-pro main table tbody td > div:not([class*="flex"]):not([class*="grid"]):not([class*="absolute"]):not([class*="relative"]) {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }
  body.mbus-desktop-pro main table tbody td > div:not([class*="flex"]):not([class*="grid"]) + div:not([class*="flex"]):not([class*="grid"])::before {
    content: " · ";
    color: #94a3b8;
  }
  body.mbus-desktop-pro main table .text-xs,
  body.mbus-desktop-pro main table [class*="text-xs"],
  body.mbus-desktop-pro main table .text-muted-foreground,
  body.mbus-desktop-pro main table [class*="text-muted"] {
    font-size: 10.5px !important;
    line-height: 1.05 !important;
    color: var(--mbus-file-muted) !important;
  }
  body.mbus-desktop-pro main table .font-mono { font-size: 11.5px !important; }
  body.mbus-desktop-pro main table .font-semibold,
  body.mbus-desktop-pro main table .font-bold { font-weight: 800 !important; }
  body.mbus-desktop-pro main table td .flex { gap: 4px !important; }
  body.mbus-desktop-pro main table button,
  body.mbus-desktop-pro main table a.inline-flex,
  body.mbus-desktop-pro main table [role="button"] {
    min-height: 22px !important;
    height: 22px !important;
    padding: 0 6px !important;
    border-radius: 5px !important;
    font-size: 10.5px !important;
  }
  body.mbus-desktop-pro main table button svg,
  body.mbus-desktop-pro main table a.inline-flex svg {
    width: 12px !important;
    height: 12px !important;
  }
  body.mbus-desktop-pro main table [class*="rounded-full"],
  body.mbus-desktop-pro main table [data-slot="badge"],
  body.mbus-desktop-pro main table [class*="badge"] {
    min-height: 17px !important;
    height: 17px !important;
    padding: 0 6px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    line-height: 1 !important;
  }

  /* Explorer vrstični seznami, če stran nima tabele. */
  body.mbus-desktop-pro main .mbus-global-explorer-list {
    border-radius: 6px !important;
    box-shadow: none !important;
    margin-top: 4px !important;
  }
  body.mbus-desktop-pro main .mbus-global-explorer-list > .mbus-global-explorer-item {
    min-height: 28px !important;
    padding: 3px 7px !important;
    gap: 7px !important;
  }
  body.mbus-desktop-pro main .mbus-global-explorer-list > .mbus-global-explorer-item::before {
    flex-basis: 15px !important;
    width: 15px !important;
    height: 15px !important;
    border-radius: 3px !important;
  }

  /* Lokacije so najpogostejši dolg seznam: dodatno stisni gumbe in stolpce. */
  body.mbus-desktop-route-lokacije main table th:first-child,
  body.mbus-desktop-route-lokacije main table td:first-child { width: 28px !important; padding-left: 7px !important; padding-right: 3px !important; }
  body.mbus-desktop-route-lokacije main table th:last-child,
  body.mbus-desktop-route-lokacije main table td:last-child { width: 260px !important; }
  body.mbus-desktop-route-lokacije main table td:last-child > div { justify-content: flex-start !important; flex-wrap: nowrap !important; }
  body.mbus-desktop-route-lokacije main table td:last-child button { max-width: 72px !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  body.mbus-desktop-route-lokacije .mbus-loc-range-btn {
    height: 30px !important;
    min-height: 30px !important;
    border-radius: 7px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    box-shadow: none !important;
  }

  /* Zaloga povzetek naj ne zasede pol zaslona. */
  body.mbus-desktop-route-zaloga main [class*="grid"] > [class*="border"] {
    min-height: 58px !important;
  }
  body.mbus-desktop-route-zaloga main [class*="text-3xl"],
  body.mbus-desktop-route-zaloga main [class*="text-4xl"] {
    font-size: 22px !important;
  }

  /* Dialogi so lahko malo večji za urejanje, vendar ne ogromni. */
  body.mbus-desktop-pro [role="dialog"] {
    border-radius: 10px !important;
  }
  body.mbus-desktop-pro [role="dialog"] input,
  body.mbus-desktop-pro [role="dialog"] [role="combobox"] {
    height: 36px !important;
    min-height: 36px !important;
  }
}

@media (min-width: 901px) and (max-width: 1250px) {
  body.mbus-desktop-pro { --mbus-desktop-sidebar: 224px !important; }
  body.mbus-desktop-pro .mbus-desktop-probar { grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) max-content !important; }
  body.mbus-desktop-pro .mbus-desktop-clock { display: none !important; }
}

@media print {
  body.mbus-desktop-pro main table thead th,
  body.mbus-desktop-pro main table tbody td {
    height: auto !important;
    padding: 2px 4px !important;
    font-size: 9px !important;
  }
}
