/* ============================================
   MODERN ADMIN PAGES — shared classes
   Use: <div class="adm-page">
   ============================================ */

.adm-page {
    padding: 18px 22px;
}

.adm-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.adm-head h1 {
    margin: 0 0 4px;
    font-size: 1.45rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}
.adm-head p {
    margin: 0;
    color: #6b7280;
    font-size: 0.85rem;
}

/* ===== Filters card ===== */
.adm-filters {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.adm-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    align-items: end;
}
.adm-fld {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.adm-fld label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}
.adm-fld input,
.adm-fld select {
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.86rem;
    background: #fff;
    color: #111827;
    transition: border-color 0.15s;
    width: 100%;
}
.adm-fld input:hover,
.adm-fld select:hover { border-color: #cbd5e1; }
.adm-fld input:focus,
.adm-fld select:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 0 3px rgba(79,195,247,0.15);
}

/* ===== Table card ===== */
.adm-table-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.adm-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
.adm-loading-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4fc3f7, transparent);
    animation: adm-loading 1.2s ease-in-out infinite;
    z-index: 5;
}
@keyframes adm-loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
.adm-table thead th {
    background: #1a1a2e;
    color: #fff;
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 0;
    white-space: nowrap;
}
.adm-table thead th.center { text-align: center; }
.adm-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}
.adm-table tbody tr:hover { background: #f9fafb; }
.adm-table tbody tr:last-child { border-bottom: 0; }
.adm-table tbody td {
    padding: 11px 14px;
    color: #1f2937;
    vertical-align: middle;
}
.adm-table tbody td.center { text-align: center; }
.adm-cell-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem; }
.adm-cell-bold { font-weight: 600; color: #111827; }
.adm-cell-muted { color: #6b7280; font-size: 0.82rem; }
.adm-cell-date { color: #4b5563; font-size: 0.8rem; white-space: nowrap; }
.adm-empty {
    padding: 50px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ===== Chips / Pills ===== */
.adm-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.adm-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
}
.adm-pill-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.adm-pill-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.adm-pill-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

/* Action chips by action type */
.adm-action {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.adm-action-login { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.adm-action-loginfail { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.adm-action-create { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.adm-action-edit { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.adm-action-user { background: #f5f3ff; color: #6d28d9; border: 1px solid #d8b4fe; }
.adm-action-delete { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.adm-action-default { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }

/* Type chips reused */
.adm-type-chip {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.adm-type-usa { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.adm-type-mx { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.adm-type-trucks { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

/* ===== Row action buttons ===== */
.adm-row-acts {
    display: inline-flex;
    gap: 6px;
    justify-content: center;
}
.adm-row-act {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.adm-row-view {
    background: rgba(79,195,247,0.12);
    border-color: rgba(79,195,247,0.3);
    color: #1e88e5;
}
.adm-row-view:hover {
    background: #1e88e5;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(30,136,229,0.35);
}
.adm-row-open {
    background: rgba(34,197,94,0.12);
    border-color: rgba(34,197,94,0.3);
    color: #16a34a;
}
.adm-row-open:hover {
    background: #16a34a;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(22,163,74,0.35);
}
.adm-row-diff {
    background: rgba(168,85,247,0.12);
    border-color: rgba(168,85,247,0.3);
    color: #a855f7;
}
.adm-row-diff:hover {
    background: #a855f7;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(168,85,247,0.35);
}

/* ===== Footer / Pagination ===== */
.adm-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
    flex-wrap: wrap;
    gap: 12px;
}
.adm-page-info {
    color: #6b7280;
    font-size: 0.82rem;
}
.adm-pg-btns {
    display: inline-flex;
    gap: 4px;
}
.adm-pg-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.adm-pg-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.adm-pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.adm-pg-active {
    background: #1f2937 !important;
    color: #fff !important;
    border-color: #1f2937 !important;
}

@media (max-width: 768px) {
    .adm-page { padding: 12px; }
    .adm-head h1 { font-size: 1.15rem; }
    .adm-filter-grid { grid-template-columns: 1fr 1fr; }
    .adm-table thead { display: none; }
    .adm-table tbody tr {
        display: block;
        padding: 10px;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        margin-bottom: 8px;
        background: #fff;
    }
    .adm-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border: 0;
        font-size: 0.85rem;
    }
    .adm-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: 0.75rem;
        text-transform: uppercase;
    }
}
