.page-header {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px 28px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.page-header h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.page-header p {
    margin-top: 6px;
    margin-bottom: 0;
    color: #6b7280;
    font-size: 14px;
}

.toolbar {
    margin-bottom: 20px;
    padding: 18px 22px;
}

.module-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
}

.module-actions .filters-actions {
    margin-top: 0;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    flex: 1;
}

.search-box input {
    width: 100%;
    height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 15px;
    outline: none;
    transition: 0.2s;
}

.search-box input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

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

.table-custom thead th {
    text-align: left;
    padding: 16px 14px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    font-size: 14px;
}

.table-custom tbody td {
    padding: 18px 14px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #111827;
}

.table-custom tbody tr:hover {
    background: #f9fafb;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: none;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.empty-table {
    text-align: center;
    padding: 40px 20px !important;
    color: #6b7280 !important;
}

.page-header .filters-actions {
    margin-top: 0;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.permissions-module {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #f9fafb;
}

.permissions-module h4 {
    margin: 0 0 10px;
    color: #111827;
    font-size: 15px;
    line-height: 1.3;
}

.permission-option {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
    align-items: flex-start;
    padding: 11px 0;
    border-top: 1px solid #e5e7eb;
    cursor: pointer;
}

.permission-option:first-of-type {
    border-top: none;
}

.permission-option input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px !important;
    padding: 0 !important;
    margin: 2px 0 0;
    border-radius: 4px;
    flex: 0 0 18px;
    cursor: pointer;
    accent-color: #2563eb;
}

.permission-option span,
.permission-option small {
    display: block;
}

.permission-option span {
    min-width: 0;
}

.permission-option strong {
    color: #111827;
    font-size: 14px;
    line-height: 1.35;
}

.permission-option small {
    margin-top: 3px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form .btn,
    .page-header .btn {
        width: 100%;
        text-align: center;
    }

    .module-actions {
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }

    .table-custom {
        display: block;
        overflow-x: auto;
    }
}
