/* ═══════════════════════════════════════════════════════════════
   MSA ERP — Tabler-style UI Theme
   Applies to all content pages. Sidebar handled in base.html.
   ═══════════════════════════════════════════════════════════════ */

/* ── Page Layout ── */
.tlb-page-body {
    padding: 1.25rem 1.5rem;
    min-height: calc(100vh - 4rem);
}

/* ── Page Header ── */
.tlb-page-header {
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.tlb-page-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}
.tlb-page-title i { color: #64748b; font-size: 1.1em; }
.tlb-page-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
}
.tlb-page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Card ── */
.tlb-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    overflow: hidden;
}
.tlb-card-header {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #fff;
}
.tlb-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tlb-card-body { padding: 1.25rem; }
.tlb-card-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* ── Filter Bar ── */
.tlb-filter-bar {
    padding: 0.75rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: flex-end;
}
.tlb-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.tlb-filter-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}
.tlb-filter-input,
.tlb-filter-select {
    height: 2rem;
    padding: 0 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tlb-filter-input:focus,
.tlb-filter-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}

/* ── Tables ── */
.tlb-table-wrap { overflow-x: auto; }
.tlb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.tlb-table thead th {
    padding: 0.5rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.tlb-table thead th.text-right { text-align: right; }
.tlb-table thead th.text-center { text-align: center; }
.tlb-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}
.tlb-table tbody tr:last-child { border-bottom: none; }
.tlb-table tbody tr:hover { background: #f8fafc; }
.tlb-table tbody td {
    padding: 0.6875rem 1rem;
    color: #334155;
    vertical-align: middle;
}
.tlb-table tbody td.text-right { text-align: right; }
.tlb-table tbody td.text-center { text-align: center; }
.tlb-table tbody td.muted { color: #94a3b8; }
.tlb-table tbody td.mono { font-family: ui-monospace, monospace; font-size: 0.75rem; }

/* ── Buttons ── */
.tlb-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.tlb-btn i { font-size: 0.9375rem; }
.tlb-btn-sm { padding: 0.3125rem 0.625rem; font-size: 0.75rem; }
.tlb-btn-primary   { background: #2563eb; color: #fff; border-color: #2563eb; }
.tlb-btn-primary:hover   { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.tlb-btn-success   { background: #059669; color: #fff; border-color: #059669; }
.tlb-btn-success:hover   { background: #047857; border-color: #047857; color: #fff; }
.tlb-btn-warning   { background: #d97706; color: #fff; border-color: #d97706; }
.tlb-btn-warning:hover   { background: #b45309; border-color: #b45309; color: #fff; }
.tlb-btn-danger    { background: #dc2626; color: #fff; border-color: #dc2626; }
.tlb-btn-danger:hover    { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.tlb-btn-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.tlb-btn-secondary:hover { background: #f9fafb; color: #111827; border-color: #9ca3af; }
.tlb-btn-ghost     { background: transparent; color: #4b5563; border-color: transparent; }
.tlb-btn-ghost:hover     { background: #f1f5f9; color: #111827; }
.tlb-btn-indigo    { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.tlb-btn-indigo:hover    { background: #4338ca; border-color: #4338ca; color: #fff; }
.tlb-btn-teal      { background: #0d9488; color: #fff; border-color: #0d9488; }
.tlb-btn-teal:hover      { background: #0f766e; border-color: #0f766e; color: #fff; }
.tlb-btn-purple    { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.tlb-btn-purple:hover    { background: #6d28d9; border-color: #6d28d9; color: #fff; }

/* ── Status Badges ── */
.tlb-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    white-space: nowrap;
}
.tlb-badge-blue   { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.tlb-badge-green  { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.tlb-badge-red    { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.tlb-badge-amber  { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.tlb-badge-gray   { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.tlb-badge-purple { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.tlb-badge-teal   { background: #ccfbf1; color: #0f766e; border-color: #99f6e4; }
.tlb-badge-orange { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.tlb-badge-indigo { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }

/* ── Stat Cards ── */
.tlb-stat-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.tlb-stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.125rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.tlb-stat-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.tlb-stat-icon-blue   { background: #dbeafe; color: #2563eb; }
.tlb-stat-icon-green  { background: #d1fae5; color: #059669; }
.tlb-stat-icon-amber  { background: #fef3c7; color: #d97706; }
.tlb-stat-icon-red    { background: #fee2e2; color: #dc2626; }
.tlb-stat-icon-purple { background: #ede9fe; color: #7c3aed; }
.tlb-stat-icon-teal   { background: #ccfbf1; color: #0d9488; }
.tlb-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}
.tlb-stat-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}
.tlb-stat-sub {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ── Pagination ── */
.tlb-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.8125rem;
}
.tlb-pagination-info { color: #64748b; }
.tlb-pagination-links { display: flex; gap: 0.25rem; }
.tlb-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #374151;
    text-decoration: none;
    background: #fff;
    transition: all 0.1s;
}
.tlb-page-link:hover { background: #f1f5f9; border-color: #cbd5e1; }
.tlb-page-link.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.tlb-page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ── Empty State ── */
.tlb-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #94a3b8;
}
.tlb-empty-icon { font-size: 2rem; margin-bottom: 0.75rem; color: #cbd5e1; display: block; }
.tlb-empty-title { font-size: 0.875rem; font-weight: 600; color: #475569; margin-bottom: 0.25rem; }
.tlb-empty-text { font-size: 0.8125rem; }

/* ── Section Divider ── */
.tlb-divider { border: none; border-top: 1px solid #e2e8f0; margin: 1.25rem 0; }

/* ── Inline Action Cell (table row actions) ── */
.tlb-row-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: flex-end;
}
