body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

.header {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1,
h2 {
    color: #1c1e21;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.btn:disabled {
    background-color: #ccd0d5;
    color: #8d949e;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #1877f2;
    color: white;
}

.btn-success {
    background-color: #42b72a;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-delete {
    background-color: #fa383e;
    color: white;
}

.btn-sm {
    font-size: 12px;
    padding: 5px 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1877f2;
}

.stat-label {
    color: #606770;
    font-size: 0.9rem;
}

.section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.table-container {
    overflow-x: auto;
}

/* ========================================================================== */
/* FINAL AND CORRECT TABLE ALIGNMENT SOLUTION V4                              */
/* ========================================================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Rule 1: Apply a MINIMUM height to all DATA cells (td). */
/* This is the definitive fix that forces all rows to be the same height. */
.data-table td {
    min-height: 60px;
}

/* Rule 2: Vertically center content in all cells (header and data). */
.data-table th,
.data-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    vertical-align: middle;
}

/* Rule 3: Keep explicit widths for horizontal consistency. */
.data-table th {
    background-color: #f5f6f7;
    color: #606770;
}
.data-table th:nth-child(1) { width: 10%; }
.data-table th:nth-child(2) { width: 11%; }
.data-table th:nth-child(3) { width: 9%; }
.data-table th:nth-child(4) { width: 11%; }
.data-table th:nth-child(5) { width: 18%; }
.data-table th:nth-child(6) { width: 9%; }
.data-table th:nth-child(7) { width: 9%; }
.data-table th:nth-child(8) { width: 23%; }

/* Rule 4: Keep flexbox rules for button alignment. */
.actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    white-space: nowrap;
}
/* ======================== END OF FINAL SOLUTION ======================== */


.status-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #606770;
}

.form-input,
.role-select {
    width: 100%;
    padding: 8px;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #fff;
    font-size: 14px;
}

.role-select:disabled {
    background-color: #f0f2f5;
    color: #606770;
}

.loading td,
.stat-card.loading {
    color: #999;
}

.form-inline {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-inline input {
    flex-grow: 1;
}

.bulk-form textarea {
    width: 100%;
    min-height: 150px;
    margin-bottom: 10px;
    padding: 10px;
    font-family: monospace;
    font-size: 14px;
}

.bulk-form {
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-link {
    padding: 10px 20px;
    text-decoration: none;
    color: #606770;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

.tab-link:hover {
    background-color: #f0f2f5;
}

.tab-link.active {
    color: #1877f2;
    border-bottom: 3px solid #1877f2;
}

/* Status Badge Colors */
.status-draft { background-color: #e2e3e5; color: #383d41; }
.status-published { background-color: #d1ecf1; color: #0c5460; }
.status-available { background-color: #fff3cd; color: #856404; }
.status-used { background-color: #d4edda; color: #155724; }
.status-active { background-color: #cce5ff; color: #004085; }
.status-disabled { background-color: #f8d7da; color: #721c24; }