/* PUL Global Responsive System — structure only, no font shrinking */

html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

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

input,
select,
textarea,
button {
    max-width: 100%;
}

/* Tables: never burst mobile layouts */
.pul-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    display: block;
    border-radius: 10px;
}

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

/* Wide admin tables should scroll instead of destroying the page */
@media (max-width: 900px) {
    .pul-table-scroll table {
        min-width: max-content;
    }

    table {
        max-width: 100%;
    }

    th,
    td {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    /* Neutralize fixed desktop widths on mobile */
    [style*="width:500px"],
    [style*="width: 500px"],
    [style*="width:600px"],
    [style*="width: 600px"],
    [style*="width:700px"],
    [style*="width: 700px"],
    [style*="width:800px"],
    [style*="width: 800px"],
    [style*="width:900px"],
    [style*="width: 900px"],
    [style*="width:1000px"],
    [style*="width: 1000px"],
    [style*="width:1100px"],
    [style*="width: 1100px"],
    [style*="width:1200px"],
    [style*="width: 1200px"],
    [style*="max-width:1000px"],
    [style*="max-width: 1000px"],
    [style*="max-width:1100px"],
    [style*="max-width: 1100px"],
    [style*="max-width:1200px"],
    [style*="max-width: 1200px"],
    [style*="min-width:700px"],
    [style*="min-width: 700px"],
    [style*="min-width:800px"],
    [style*="min-width: 800px"],
    [style*="min-width:900px"],
    [style*="min-width: 900px"],
    [style*="210mm"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Tailwind/admin utility rescue */
    [class*="min-w-"] {
        min-width: 0 !important;
    }

    .container,
    .main,
    .content,
    .dashboard,
    .dashboard-content,
    .admin-content,
    .page-content,
    main,
    section {
        max-width: 100%;
    }

    aside,
    nav,
    .sidebar,
    [class*="sidebar"] {
        max-width: 100%;
    }
}

/* Phone layout: stack grids and forms cleanly */
@media (max-width: 700px) {
    .grid,
    [class*="grid-cols-"],
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    form {
        max-width: 100%;
    }

    .flex,
    [style*="display:flex"],
    [style*="display: flex"] {
        flex-wrap: wrap;
    }

    .card,
    .box,
    .panel,
    .stat-card,
    .dashboard-card {
        max-width: 100%;
    }
}

/* Desktop remains untouched */
@media print {
    html,
    body {
        overflow-x: visible !important;
        max-width: none !important;
    }

    .pul-table-scroll {
        overflow: visible !important;
    }
}
/*pul-shell-fix*/ @media (max-width:900px){ [class*="w-64"],[class*="w-72"],[class*="w-80"],[class*="w-56"],[class*="w-96"]{width:100%!important;max-width:100%!important;} [class*="min-w-"]{min-width:0!important;} }


/*pul-cards-fix*/ @media (max-width:900px){
 table.pul-cards{min-width:0!important;width:100%!important;}
 table.pul-cards, table.pul-cards tbody, table.pul-cards tr, table.pul-cards td { display:block; width:100%!important; }
 table.pul-cards thead { display:none; }
 table.pul-cards tr { border:1px solid #e2e8f0; border-radius:12px; margin-bottom:10px; padding:6px 4px; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.06); }
 table.pul-cards td { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:7px 10px; border:0!important; }
 table.pul-cards td:before { content: attr(data-label); font-weight:700; color:#475569; flex:0 0 42%; }
 table.pul-cards td:empty { display:none; }
 table.pul-cards .pul-table-scroll, .pul-table-scroll:has(table.pul-cards){overflow:visible!important;}
}
